Implement multi identity caller that looks at the server cert while selecting the client one#613
Merged
sfc-gh-mjankowski merged 2 commits intomainfrom Mar 19, 2026
Merged
Conversation
d3a16e3 to
af35f4b
Compare
8a3e2cb to
4872714
Compare
sfc-gh-ssapkowski
requested changes
Mar 19, 2026
4872714 to
a52c491
Compare
aeeb35c to
57a8bdb
Compare
57a8bdb to
aed72f8
Compare
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.
The mTLS handshake and where we inject new logic
The diagram below shows the messages exchanged during a standard mTLS
handshake (TLS 1.2 flow shown for clarity; TLS 1.3 reorders some messages
but the certificate selection logic is equivalent). The highlighted step
is where
MultiIdentityCredentialsinjects its identity-selection logic.In standard (single-identity) mTLS the client always sends the same
certificate regardless of what the server asks for. With
MultiIdentityCredentials, theGetClientCertificatecallback inspectsthe server's
CertificateRequestand dynamically picks the right identity.Proxy server wiring
The proxy server's credential extraction was refactored to support two paths:
clientCredSources): preserves the existingWrappedTransportCredentialsbehavior with its own refresh/metrics/logging.clientCredSources): loads each source as aClientIdentityand creates aMultiIdentityCredentials.The server-side (incoming) credentials are unchanged and still use the single
credSource.