[CELEBORN-2386] Pass peer hostname to SSLEngine for SNI support#3764
Open
shellfish007 wants to merge 1 commit into
Open
[CELEBORN-2386] Pass peer hostname to SSLEngine for SNI support#3764shellfish007 wants to merge 1 commit into
shellfish007 wants to merge 1 commit into
Conversation
SSLFactory.createEngine() called jdkSslContext.createSSLEngine() with no arguments. The JDK only includes the SNI extension in the TLS ClientHello when a peer hostname is provided via createSSLEngine(host, port). Without SNI, TLS termination/routing that depends on server name (e.g. Istio PASSTHROUGH/SIMPLE, or any SNI-based multi-tenant ingress) cannot route or differentiate connections. Thread peer hostname/port from TransportClientFactory.internalCreateClient() through TransportContext.initializePipeline() to SSLFactory.createSSLEngine(), which now calls jdkSslContext.createSSLEngine(peerHost, peerPort) for client connections. Existing server-side and no-arg callers are unaffected via backward-compatible overloads.
There was a problem hiding this comment.
Pull request overview
This PR adds Server Name Indication (SNI) support for TLS client connections by threading the peer hostname/port through the Netty transport initialization path into SSLFactory so the JDK can emit SNI in the TLS ClientHello.
Changes:
- Add
TransportContext.initializePipeline(...)overloads that acceptpeerHost/peerPortand pass them to SSL setup. - Update
TransportClientFactory.internalCreateClient()to provide the remote peer host/port when initializing the client channel pipeline. - Extend
SSLFactory.createSSLEngine(...)with a peer host/port overload and useSSLContext#createSSLEngine(host, port)for client engines.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| common/src/main/java/org/apache/celeborn/common/network/TransportContext.java | Adds pipeline initialization overloads carrying peer host/port into SslHandler engine creation. |
| common/src/main/java/org/apache/celeborn/common/network/ssl/SSLFactory.java | Introduces SSLEngine creation overload that uses createSSLEngine(peerHost, peerPort) for client-side SNI. |
| common/src/main/java/org/apache/celeborn/common/network/client/TransportClientFactory.java | Passes remote address host/port into pipeline initialization for client connections. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+309
to
312
| TransportChannelHandler clientHandler = | ||
| context.initializePipeline( | ||
| ch, decoder, true, address.getHostString(), address.getPort()); | ||
| clientRef.set(clientHandler.getClient()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Thread peer hostname/port from
TransportClientFactory.internalCreateClient()throughTransportContext.initializePipeline()toSSLFactory.createSSLEngine().SSLFactory.createEngine()now callsjdkSslContext.createSSLEngine(peerHost, peerPort)for client connections, which makes the JDK include the SNI extension in the TLS ClientHello. Existing server-side and no-arg callers use backward-compatible overloads.Why are the changes needed?
SSLFactory.createEngine()calledjdkSslContext.createSSLEngine()with no arguments. The JDK only includes the SNI extension in the TLS ClientHello when a peer hostname is provided viacreateSSLEngine(host, port). Without SNI, TLS termination/routing that depends on server name (e.g. an SNI-based ingress/gateway such as Istio TLS PASSTHROUGH or SIMPLE mode) cannot route or differentiate connections by hostname. This fix is a prerequisite for shared-port multi-tenant routing through an SNI-based ingress gateway.Does this PR introduce any user-facing change?
No. Client
SSLEnginecreation now includes SNI; server-side and existing no-arg callers are unaffected.How was this patch tested?
Follows the existing
SSLFactory/TransportContextcall patterns with additive, backward-compatible overloads — no new config surface. Relies on CI for build/test verification.