fix: disable cross-SNI TLS session reuse in egress - #1764
Open
Kuromesi (Kuromesi) wants to merge 1 commit into
Open
Kuromesi (Kuromesi) wants to merge 1 commit into
Kuromesi (Kuromesi) wants to merge 1 commit into
Conversation
Disable upstream session resumption on all four MITM origin clusters because the pinned Envoy version shares cached sessions across server names. This prevents SAN validation failures when another origin accepts a cached ticket while retaining certificate verification and HTTP connection reuse.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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 MITM egress gateway shares an upstream TLS context across multiple hostnames. Envoy's session cache is not scoped by SNI, so a session established for one hostname can be offered to another. If the second origin accepts the ticket, the cached certificate identity may fail SAN validation, resulting in HTTP 503 responses.
Reproduction
The issue was reproduced by sequentially accessing
https://cdn.npmmirror.comandhttps://open.feishu.cnthrough an egress gateway:max_session_keys: 0makes both connections complete full handshakes and reach their HTTP upstreams.Reproduction depends on the second origin accepting the cached ticket and both connections using the same gateway TLS context.
Change
Set
max_session_keys: 0on all four MITM origin TLS clusters, covering HTTP and gRPC over both dynamic forward proxy and original-destination routing.SNI, SAN/CA validation, and HTTP connection reuse remain enabled. New TLS connections require full handshakes. Revisit this workaround after upgrading to a build containing envoyproxy/envoy#45982 with SNI-scoped caching enabled.
make verify(code generation blocked by local Python 3.9)No live Substrate handshake or performance testing was performed.