mirror of
https://github.com/nginx/nginx.git
synced 2024-12-20 06:03:31 -06:00
SSL: SSL_CTX_set_timeout() now always called.
The timeout set is used by OpenSSL as a hint for clients in TLS Session Tickets. Previous code resulted in a default timeout (5m) used for TLS Sessions Tickets if there was no session cache configured. Prodded by Piotr Sikora.
This commit is contained in:
parent
87a607a031
commit
a8ad0c02cc
@ -1704,6 +1704,8 @@ ngx_ssl_session_cache(ngx_ssl_t *ssl, ngx_str_t *sess_ctx,
|
|||||||
{
|
{
|
||||||
long cache_mode;
|
long cache_mode;
|
||||||
|
|
||||||
|
SSL_CTX_set_timeout(ssl->ctx, (long) timeout);
|
||||||
|
|
||||||
if (builtin_session_cache == NGX_SSL_NO_SCACHE) {
|
if (builtin_session_cache == NGX_SSL_NO_SCACHE) {
|
||||||
SSL_CTX_set_session_cache_mode(ssl->ctx, SSL_SESS_CACHE_OFF);
|
SSL_CTX_set_session_cache_mode(ssl->ctx, SSL_SESS_CACHE_OFF);
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
@ -1749,8 +1751,6 @@ ngx_ssl_session_cache(ngx_ssl_t *ssl, ngx_str_t *sess_ctx,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SSL_CTX_set_timeout(ssl->ctx, (long) timeout);
|
|
||||||
|
|
||||||
if (shm_zone) {
|
if (shm_zone) {
|
||||||
SSL_CTX_sess_set_new_cb(ssl->ctx, ngx_ssl_new_session);
|
SSL_CTX_sess_set_new_cb(ssl->ctx, ngx_ssl_new_session);
|
||||||
SSL_CTX_sess_set_get_cb(ssl->ctx, ngx_ssl_get_cached_session);
|
SSL_CTX_sess_set_get_cb(ssl->ctx, ngx_ssl_get_cached_session);
|
||||||
|
Loading…
Reference in New Issue
Block a user