From: Vadim Zhestikov Date: Wed, 14 Oct 2026 17:48:06 +0000 (-0700) Subject: Stream: client SSL certificates were not checked with SNI X-Git-Tag: release-1.31.9~14 X-Git-Url: https://git.kaiwu.me/web/%22data:,/doc/static/%7B@url%7D?a=commitdiff_plain;h=6f9fceed8dd7eb7d39b3930dc4f6824ecfe88559;p=nginx.git Stream: client SSL certificates were not checked with SNI If the SSL handshake completed in the first call of ngx_stream_ssl_handler(), the client certificate was verified using the configuration of the default server, rather than the virtual server selected by SNI during the handshake. The problem appeared in d21675228 (1.25.5). It is similar to the one fixed in 620c9a4c4. The fix is to re-read the server configuration before verifying the client certificate. Reported by CERT.PL. --- diff --git a/src/stream/ngx_stream_ssl_module.c b/src/stream/ngx_stream_ssl_module.c index c68333a1c..be1e50335 100644 --- a/src/stream/ngx_stream_ssl_module.c +++ b/src/stream/ngx_stream_ssl_module.c @@ -462,6 +462,8 @@ ngx_stream_ssl_handler(ngx_stream_session_t *s) } } + sscf = ngx_stream_get_module_srv_conf(s, ngx_stream_ssl_module); + if (sscf->verify) { rc = SSL_get_verify_result(c->ssl->connection);