]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: ssl: isolate TLS session resumption per X509 server certificate
authorWilliam Lallemand <wlallemand@haproxy.com>
Fri, 14 Aug 2026 12:02:42 +0000 (12:02 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 18 Aug 2026 12:08:17 +0000 (14:08 +0200)
commit5d5f12376e51039b69720e23dc3bcca3b598d002
tree2719166a827c5bfa4d421170de0d8ff7c53f075f
parent379a07153a80d0c276e5956f5fe18b530b03fbe2
BUG/MEDIUM: ssl: isolate TLS session resumption per X509 server certificate

The shared SSL session cache (stateful TLS tickets) was using the same
context ID (SHCTX_APPNAME) across all SSL_CTX in the process. It allowed
a client to resume from one bind line to another even if the SSL_CTX
wasn't using the same key/cert pair.

Stateless TLS tickets are less impacted since a random tls-ticket-key is
automatically generated by SSL_CTX, only bind lines with the same
tls-ticket-keys would have the problem.

This patch fixes the issue by setting a session ID derived from the X509
certificate,a SHA-256 digest of the SHCTX_APPNAME. plus the Issuer,
Subject and Serial of the frontend's own leaf certificate
(ssl_ctx_hash_leaf_X509()

Two SSL_CTX serving different certificates now get different sid_ctx
values, so OpenSSL's own resumption check actually has something to
compare and rejects cross-certificate resumption instead of always
matching.

This must be backported in every stable release.
src/ssl_sock.c