diff options
author | Itamar Haber <itamar@redislabs.com> | 2020-07-10 16:22:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-10 16:22:58 +0300 |
commit | a6504a16f70511c06bd5460b7cdfee6247cb09a6 (patch) | |
tree | ed0a47f5c181e8bfc046d0d9bd6b7da64cf98e0a /src/tls.c | |
parent | 91d309681cf9db8c3b8d4f2d828c336cff661efb (diff) | |
parent | d5648d617e1ed5b9cfa575ad412bc9d450b16afd (diff) | |
download | redis-conduct.tar.gz |
Merge branch 'unstable' into conductconduct
Diffstat (limited to 'src/tls.c')
-rw-r--r-- | src/tls.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -148,9 +148,6 @@ void tlsInit(void) { } pending_list = listCreate(); - - /* Server configuration */ - server.tls_auth_clients = 1; /* Secure by default */ } /* Attempt to configure/reconfigure TLS. This operation is atomic and will @@ -184,6 +181,15 @@ int tlsConfigure(redisTLSContextConfig *ctx_config) { SSL_CTX_set_options(ctx, SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS); #endif + if (ctx_config->session_caching) { + SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_SERVER); + SSL_CTX_sess_set_cache_size(ctx, ctx_config->session_cache_size); + SSL_CTX_set_timeout(ctx, ctx_config->session_cache_timeout); + SSL_CTX_set_session_id_context(ctx, (void *) "redis", 5); + } else { + SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF); + } + int protocols = parseProtocolsConfig(ctx_config->protocols); if (protocols == -1) goto error; @@ -337,9 +343,7 @@ connection *connCreateAcceptedTLS(int fd, int require_auth) { conn->c.state = CONN_STATE_ACCEPTING; if (!require_auth) { - /* We still verify certificates if provided, but don't require them. - */ - SSL_set_verify(conn->ssl, SSL_VERIFY_PEER, NULL); + SSL_set_verify(conn->ssl, SSL_VERIFY_NONE, NULL); } SSL_set_fd(conn->ssl, conn->c.fd); |