Mercurial > hg > nginx-quic
comparison src/event/ngx_event_openssl.c @ 8809:e30f7dc7f143
SSL: always renewing tickets with TLSv1.3 (ticket #1892).
Chrome only uses TLS session tickets once with TLS 1.3, likely following
RFC 8446 Appendix C.4 recommendation. With OpenSSL, this works fine with
built-in session tickets, since these are explicitly renewed in case of
TLS 1.3 on each session reuse, but results in only two connections being
reused after an initial handshake when using ssl_session_ticket_key.
Fix is to always renew TLS session tickets in case of TLS 1.3 when using
ssl_session_ticket_key, similarly to how it is done by OpenSSL internally.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 24 Jan 2022 17:18:50 +0300 |
parents | aeab41dfd260 |
children | 7c2adf237091 a736a7a613ea |
comparison
equal
deleted
inserted
replaced
8808:5d88e2bf92b3 | 8809:e30f7dc7f143 |
---|---|
4449 ngx_ssl_error(NGX_LOG_ALERT, c->log, 0, | 4449 ngx_ssl_error(NGX_LOG_ALERT, c->log, 0, |
4450 "EVP_DecryptInit_ex() failed"); | 4450 "EVP_DecryptInit_ex() failed"); |
4451 return -1; | 4451 return -1; |
4452 } | 4452 } |
4453 | 4453 |
4454 return (i == 0) ? 1 : 2 /* renew */; | 4454 /* renew if TLSv1.3 */ |
4455 | |
4456 #ifdef TLS1_3_VERSION | |
4457 if (SSL_version(ssl_conn) == TLS1_3_VERSION) { | |
4458 return 2; | |
4459 } | |
4460 #endif | |
4461 | |
4462 /* renew if non-default key */ | |
4463 | |
4464 if (i != 0) { | |
4465 return 2; | |
4466 } | |
4467 | |
4468 return 1; | |
4455 } | 4469 } |
4456 } | 4470 } |
4457 | 4471 |
4458 | 4472 |
4459 static void | 4473 static void |