Skip to content

Refactor TLS SSL context configuration#7974

Draft
Copilot wants to merge 10 commits into
mainfrom
copilot/refactor-ssl-context-usage
Draft

Refactor TLS SSL context configuration#7974
Copilot wants to merge 10 commits into
mainfrom
copilot/refactor-ssl-context-usage

Conversation

Copilot AI commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Closes #3461.

TLS connections configured both SSL_CTX and SSL directly, even though SSL inherits connection options from its context. This refactors setup so each connection’s SSL_CTX is fully configured before creating the per-connection SSL.

  • Context-first TLS setup

    • Delay SSL creation until after certificate, verification, and ALPN configuration is applied to SSL_CTX.
    • Keep connection-specific setup, such as SNI, on SSL.
  • Clear certificate configuration phases

    • Split certificate application into explicit context and connection phases:
      cert->configure_context(cfg);
      create_ssl();
      cert->configure_connection(get_ssl());
  • Safer OpenSSL handling

    • Add checks for touched OpenSSL calls and allocations.
    • Use RAII during BIO setup until ownership is transferred to OpenSSL.
  • Focused coverage

    • Add a TLS unit test confirming verification mode is inherited by the created SSL connection.

Copilot AI and others added 8 commits June 24, 2026 21:03
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 AI changed the title [WIP] Refactor use of SSL context objects Refactor TLS SSL context configuration Jun 24, 2026
Copilot AI requested a review from achamayou June 24, 2026 21:15
@achamayou

Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>

Copilot AI commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Resolved the merge conflicts in commit 766754b2b. Targeted validation passed with cmake --build build --target tls_test and ./build/tls_test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor use of SSL context objects

2 participants