Skip to content

Auto-port 5.0: Fix propagation of startTls for client SslContext handlers - #16938

Merged
normanmaurer merged 1 commit into
5.0from
auto-port-pr-16931-to-5.0
Jun 11, 2026
Merged

normanmaurer merged 1 commit into
5.0from
auto-port-pr-16931-to-5.0

Conversation

@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port of #16931 to 5.0
Cherry-picked commit: 3484bcb


Fix propagation of startTls for client SslContext handlers

Motivation:

SslContextBuilder.startTls(true) is not consistently propagated when creating client-side SslContext instances. As a result, a handler created via newHandler(...), especially through the executor-based overloads and the OPENSSL_REFCNT provider path, may behave as if startTls was false.

This is inconsistent with the builder configuration and with the existing SslHandler STARTTLS semantics.

Modifications:

  • Propagate the configured startTls flag from SslContextBuilder into client context creation.
  • Add compatibility-preserving internal overloads for client context constructors instead of replacing the existing signatures.
  • Pass startTls through ReferenceCountedOpenSslContext.newHandler(..., Executor) instead of hard-coding false.

Result:

Client-side handlers created from SslContextBuilder.startTls(true) now preserve STARTTLS behavior across OpenSSL ref-counted providers, including executor-based handler creation.

If there is no issue then describe the changes introduced by this PR.

Fix propagation of startTls for client SslContext handlers

Motivation:

`SslContextBuilder.startTls(true)` is not consistently propagated when
creating client-side `SslContext` instances. As a result, a handler
created via `newHandler(...)`, especially through the executor-based
overloads and the `OPENSSL_REFCNT` provider path, may behave as if
`startTls` was `false`.

This is inconsistent with the builder configuration and with the
existing `SslHandler` STARTTLS semantics.

Modifications:

- Propagate the configured `startTls` flag from `SslContextBuilder` into
client context creation.
- Add compatibility-preserving internal overloads for client context
constructors instead of replacing the existing signatures.
- Pass `startTls` through
`ReferenceCountedOpenSslContext.newHandler(..., Executor)` instead of
hard-coding `false`.

Result:

Client-side handlers created from `SslContextBuilder.startTls(true)` now
preserve STARTTLS behavior across OpenSSL ref-counted providers,
including executor-based handler creation.

If there is no issue then describe the changes introduced by this PR.

(cherry picked from commit 3484bcb)
@normanmaurer
normanmaurer merged commit c8ef5a7 into 5.0 Jun 11, 2026
22 of 23 checks passed
@normanmaurer
normanmaurer deleted the auto-port-pr-16931-to-5.0 branch June 11, 2026 14:04
@normanmaurer normanmaurer added this to the 5.0.0.Final milestone Jun 11, 2026
@normanmaurer normanmaurer mentioned this pull request Sep 22, 2026
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.

3 participants