]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: ssl: do not resume sessions whose client cert failed the verification master
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 1 Dec 2026 16:59:57 +0000 (16:59 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 1 Dec 2026 17:18:42 +0000 (17:18 +0000)
commita77ee87fa2455aa106c1451f4d536e35de236929
treeba70d15332f95fee80a76187ff3a53513dbc639e
parentaf62a5a23b829668a314acde640429342b93f097
BUG/MEDIUM: ssl: do not resume sessions whose client cert failed the verification

The ssl_c_err, ssl_c_ca_err and ssl_c_ca_err_depth sample fetches read
the verify errors that ssl_sock_bind_verifycbk() stores in the
connection's xprt_st. This callback is only called during a full
handshake: on a resumed session (TLS ticket, session ID or TLS 1.3 PSK),
xprt_st is reset and the callback does not run, so the three fetches
return 0 (X509_V_OK) even when the session was established with a client
certificate whose verification failed, whether the error was ignored by
"ca-ignore-err" or "crt-ignore-err" or not. ssl_c_verify is not affected
because it reads the verify result stored in the session.

A user may mistakenly rely on these fetches for access control on resumed
sessions, for example after ignoring verification errors with
"ca-ignore-err" or "crt-ignore-err". Such a configuration can reject an
expired, revoked or self-signed client certificate on the first
connection, then accept the same client when it resumes the session.

Fix this by clearing the session id context when the verification fails,
whether the error is ignored or not, so that a session established with
a failed verification cannot be resumed: the next connection performs a
full handshake and the verify callback fills xprt_st again.

Sessions whose verification succeeded keep resuming as before.

This should be backported to all stable branches after an observation period.

Reported-by: Justin Sun <justin@capy.ai>
doc/configuration.txt
src/ssl_sock.c