Refresh default TLS context on secret update - #13342
Conversation
moonchen
left a comment
There was a problem hiding this comment.
👍 to covering the default/no-SNI context on secret updates. A couple of issues with the new refresh loop, plus some smalls.
|
|
||
| QUICCertConfig::scoped_config server_cert; | ||
| SSL *ssl = SSL_new(server_cert->defaultContext()); | ||
| auto default_ctx = server_cert->defaultContext(); |
There was a problem hiding this comment.
Not for this PR, but worth a note in the description or a follow-up issue: QUICCertConfig builds its own SSLCertLookup that only a full reload rebuilds, so secret updates still leave QUIC serving the stale default cert.
There was a problem hiding this comment.
Agreed. This change updates the SSLConfig lookup used by TCP TLS; QUICCertConfig maintains a separate lookup and still requires a full reload. I’m treating QUIC secret-update support as follow-up work rather than expanding this fix into that separate lifecycle.
bac9ce3 to
aee87a7
Compare
aee87a7 to
7dc7d88
Compare
7dc7d88 to
1b58230
Compare
1b58230 to
f9c7d12
Compare
Default server certificate secret updates could rebuild the TLS contexts for CN/SAN lookups while leaving the default/no-SNI context pointing at the old SSL_CTX. Operators could update cert material on disk and through the secret API, but new handshakes without a more specific match could still serve the stale certificate. This updates runtime context refresh to cover address/default lookup entries owned by the same ssl_multicert policy and retains the default context while callers create new TLS sessions. This also adds an AuTest that updates a plugin-loaded default certificate and verifies the next no-SNI handshake sees the new certificate. Fixes: apache#9562
f9c7d12 to
319e655
Compare
moonchen
left a comment
There was a problem hiding this comment.
Verified that previous findings are addressed. CI is green.
|
Cherry-picked to 10.2.x |
Default server certificate secret updates could rebuild the TLS contexts for CN/SAN lookups while leaving the default/no-SNI context pointing at the old SSL_CTX. Operators could update cert material on disk and through the secret API, but new handshakes without a more specific match could still serve the stale certificate. This updates runtime context refresh to cover address/default lookup entries owned by the same ssl_multicert policy and retains the default context while callers create new TLS sessions. This also adds an AuTest that updates a plugin-loaded default certificate and verifies the next no-SNI handshake sees the new certificate. Fixes: #9562 (cherry picked from commit 01ed487)
Default server certificate secret updates could rebuild the TLS contexts for CN/SAN lookups while leaving the default/no-SNI context pointing at the old SSL_CTX. Operators could update cert material on disk and through the secret API, but new handshakes without a more specific match could still serve the stale certificate. This updates runtime context refresh to cover address/default lookup entries owned by the same ssl_multicert policy and retains the default context while callers create new TLS sessions. This also adds an AuTest that updates a plugin-loaded default certificate and verifies the next no-SNI handshake sees the new certificate. Fixes: apache#9562
http2_max_active_streams and tls_secret_update_default used the ssl_multicert.yaml Disk API, which the 10.2.x autest harness does not provide -- it registers ssl_multicert.config -- so both tests threw AttributeError at load time. Convert them to the flat ssl_multicert.config form already used by other tests on the branch. For tls_secret_update_default this also updates the reload touch target and the diags.log wait condition, which looked for "ssl_multicert.yaml finished loading"; on 10.2.x the SSL loader logs the actual filename (ssl_multicert.config), so the reload wait would otherwise never become ready. These tests were backported (via apache#13386 and apache#13342) without adapting their config-file format to the release branch.
http2_max_active_streams and tls_secret_update_default used the ssl_multicert.yaml Disk API, which the 10.2.x autest harness does not provide -- it registers ssl_multicert.config -- so both tests threw AttributeError at load time. Convert them to the flat ssl_multicert.config form already used by other tests on the branch. For tls_secret_update_default this also updates the reload touch target and the diags.log wait condition, which looked for "ssl_multicert.yaml finished loading"; on 10.2.x the SSL loader logs the actual filename (ssl_multicert.config), so the reload wait would otherwise never become ready. These tests were backported (via #13386 and #13342) without adapting their config-file format to the release branch.
Default server certificate secret updates could rebuild the TLS
contexts for CN/SAN lookups while leaving the default/no-SNI context
pointing at the old SSL_CTX. Operators could update cert material on
disk and through the secret API, but new handshakes without a more
specific match could still serve the stale certificate.
This updates runtime context refresh to cover address/default lookup
entries owned by the same ssl_multicert policy and retains the
default context while callers create new TLS sessions. This also adds
an AuTest that updates a plugin-loaded default certificate and
verifies the next no-SNI handshake sees the new certificate.
Fixes: #9562