Conversation
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Resolved the merge conflicts in commit |
Configure certificates, trust stores, and context modes before the SSL BIO creates its connection, then apply connection-specific settings before the handshake. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR refactors the TLS setup flow so SSL_CTX is fully configured before constructing the per-connection SSL, aligning configuration with OpenSSL inheritance semantics and clarifying which settings are context-wide vs connection-specific.
Changes:
- Split certificate configuration into
Cert::configure_context(SSL_CTX*)andCert::configure_connection(SSL*), and update callers accordingly. - Delay
SSLcreation inccf::tls::Contextuntil afterSSL_CTXconfiguration is complete; add RAII protection for BIO allocation until ownership transfer. - Add a TLS unit test ensuring a connection’s
SSLinherits verification mode from its configuredSSL_CTX.
Custom instructions used:
.github/copilot-instructions.md.github/instructions/reviewing.instructions.md
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tls/context.h | Defers SSL creation until after SSL_CTX setup; improves OpenSSL allocation safety around BIO ownership transfer. |
| src/tls/cert.h | Splits cert configuration into context vs connection phases (e.g., verification/certs vs SNI). |
| src/tls/client.h | Updates TLS test client to configure context first, then create/configure the connection. |
| src/tls/server.h | Updates TLS test server to configure context (including ALPN) before creating the connection SSL. |
| src/clients/tls_client.h | Refactors client TLS context creation to apply SSL_CTX config before BIO/SSL creation; keeps connection-only config on SSL. |
| src/tls/test/main.cpp | Updates existing cert verification test and adds inheritance-focused test coverage. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot fix the code format/syntax |
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Fixed in the latest commit. The previous code review suggestions accidentally dropped the opening braces |
Closes #3461.
TLS connections configured both
SSL_CTXandSSLdirectly, even thoughSSLinherits connection options from its context. This refactors setup so each connection’sSSL_CTXis fully configured before creating the per-connectionSSL.Context-first TLS setup
SSLcreation until after certificate, verification, and ALPN configuration is applied toSSL_CTX.SSL.Clear certificate configuration phases
Safer OpenSSL handling
Focused coverage
SSLconnection.