From: Daniel Gustafsson Date: Mon, 19 Aug 2024 10:55:11 +0000 (+0200) Subject: Fix regression in TLS session ticket disabling X-Git-Tag: REL_12_21~80 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=cd98a142cb37fbef82b94a88cd72ed936854991c;p=postgresql.git Fix regression in TLS session ticket disabling Commit 274bbced disabled session tickets for TLSv1.3 on top of the already disabled TLSv1.2 session tickets, but accidentally caused a regression where TLSv1.2 session tickets were incorrectly sent. Fix by unconditionally disabling TLSv1.2 session tickets and only disable TLSv1.3 tickets when the right version of OpenSSL is used. Backpatch to all supported branches. Reported-by: Cameron Vogt Reported-by: Fire Emerald Reviewed-by: Jacob Champion Discussion: https://postgr.es/m/DM6PR16MB3145CF62857226F350C710D1AB852@DM6PR16MB3145.namprd16.prod.outlook.com Backpatch-through: v12 --- diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c index 685537268de..30f2a623d67 100644 --- a/src/backend/libpq/be-secure-openssl.c +++ b/src/backend/libpq/be-secure-openssl.c @@ -236,10 +236,9 @@ be_tls_init(bool isServerStart) */ #ifdef HAVE_SSL_CTX_SET_NUM_TICKETS SSL_CTX_set_num_tickets(context, 0); -#else +#endif #ifdef SSL_OP_NO_TICKET /* added in OpenSSL 0.9.8f */ SSL_CTX_set_options(context, SSL_OP_NO_TICKET); -#endif #endif /* disallow SSL session caching, too */