mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-06 21:51:30 +00:00
added support for ssl session caching
This commit is contained in:
+1
-1
@@ -63,7 +63,7 @@ void uwsgi_opt_https(char *opt, char *value, void *cr) {
|
||||
}
|
||||
|
||||
// initialize ssl context
|
||||
ugs->ctx = uwsgi_ssl_new_server_context(crt, key, ciphers);
|
||||
ugs->ctx = uwsgi_ssl_new_server_context(uwsgi_concat3(ucr->short_name, "-", ugs->name),crt, key, ciphers);
|
||||
// the clients must be put in non-blocking mode
|
||||
ugs->nb = 1;
|
||||
// set the ssl mode
|
||||
|
||||
@@ -4319,7 +4319,7 @@ void uwsgi_ssl_info_cb(SSL const *ssl, int where, int ret) {
|
||||
}
|
||||
}
|
||||
|
||||
SSL_CTX *uwsgi_ssl_new_server_context(char *crt, char *key, char *ciphers) {
|
||||
SSL_CTX *uwsgi_ssl_new_server_context(char *name, char *crt, char *key, char *ciphers) {
|
||||
|
||||
SSL_CTX *ctx = SSL_CTX_new(SSLv23_server_method());
|
||||
if (!ctx) {
|
||||
@@ -4381,6 +4381,16 @@ SSL_CTX *uwsgi_ssl_new_server_context(char *crt, char *key, char *ciphers) {
|
||||
|
||||
SSL_CTX_set_info_callback(ctx, uwsgi_ssl_info_cb);
|
||||
|
||||
if (name) {
|
||||
SSL_CTX_set_session_id_context(ctx, (unsigned char *)name, strlen(name));
|
||||
SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_SERVER);
|
||||
#ifdef UWSGI_DEBUG
|
||||
uwsgi_log("[uwsgi-ssl] initialized ssl session cache: %s\n", name);
|
||||
#endif
|
||||
//SSL_CTX_set_timeout
|
||||
//SSL_CTX_sess_set_cache_size
|
||||
}
|
||||
|
||||
return ctx;
|
||||
}
|
||||
|
||||
|
||||
@@ -2884,7 +2884,7 @@ char *uwsgi_substitute(char *, char *, char *);
|
||||
#include "openssl/conf.h"
|
||||
#include "openssl/ssl.h"
|
||||
void uwsgi_ssl_init(void);
|
||||
SSL_CTX *uwsgi_ssl_new_server_context(char *, char *, char *);
|
||||
SSL_CTX *uwsgi_ssl_new_server_context(char *, char *, char *, char *);
|
||||
#endif
|
||||
|
||||
#ifdef UWSGI_AS_SHARED_LIBRARY
|
||||
|
||||
Reference in New Issue
Block a user