docs: document post-handshake session verification for TLS - #3462
Open
pjfanning wants to merge 1 commit into
Open
docs: document post-handshake session verification for TLS#3462pjfanning wants to merge 1 commit into
pjfanning wants to merge 1 commit into
Conversation
The `SSLEngineProvider` trait exposes `verifyClientSession` and `verifyServerSession`, which Artery invokes after every successful TLS handshake and which fail the connection when they return `Some(cause)`. This extension point was only described in the context of `RotatingKeysSSLEngineProvider`, so users on the default JKS-based `ConfigSSLEngineProvider` had no signpost that overriding these methods is supported. Add a section to remote-security.md covering the callbacks, when to prefer `hostname-verification=on` instead, the interaction with `require-mutual-authentication`, and a compiled example that scopes a cluster to a subset of certificates issued by a shared internal CA.
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.
Motivation
The Artery
SSLEngineProvidertrait exposesverifyClientSessionandverifyServerSession.ArteryTcpTransportinvokes them after every successful TLS handshake and fails the connection when they returnSome(cause):https://github.com/apache/pekko/blob/main/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ArteryTcpTransport.scala#L145
https://github.com/apache/pekko/blob/main/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ArteryTcpTransport.scala#L261
The mechanism works and needs no code change, but it was only described in the
RotatingKeysSSLEngineProvidersection of the docs. Users on the default JKS-basedConfigSSLEngineProvider(whoseverify*methods returnNone) had no indication that overriding them is a supported extension point.Changes
Adds a "Custom post-handshake session verification" subsection to
remote-security.md, under the existing SSL/TLS configuration section:hostname-verification=onis preferred when peer hostnames are known, so the verifier is not presented as a substitute for it.require-mutual-authentication— with it off, the accepting side gets no peer certificate andgetPeerCertificatesthrowsSSLPeerUnverifiedException.RotatingKeysSSLEngineProvideras the built-in user of the same mechanism.The example is a compiled snippet (
docs/src/test/scala/docs/remoting/SSLEngineProviderDocSpec.scala) pulled in with@@snip, following the convention used elsewhere in the docs, so it cannot silently rot. It covers the shared-internal-CA case: every node's certificate is signed by the same CA and therefore accepted by the trust-store, but only a subset should be allowed into a given cluster.Docs only — no production code or configuration is changed.
Tests
sbt docs/Test/compilepasses; the snippet compiles against the realConfigSSLEngineProviderAPI.sbt docs/scalafmtrun; the snippet is unchanged by it.sbt docs/headerCreateAllgenerated the license header on the new file.sbt docs/paradoxwas not run locally; relying on CI to validate the@@snipreference and link rendering.References
SSLEngineProvidertrait:remote/src/main/scala/org/apache/pekko/remote/artery/tcp/SSLEngineProvider.scalaremote/src/main/scala/org/apache/pekko/remote/artery/tcp/ConfigSSLEngineProvider.scalaremote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/RotatingKeysSSLEngineProvider.scala