Skip to content

fix(gatewayapi): disable HTTP/2 on every same-port peer of an SDS listener - #10468

Open
yuminn-k wants to merge 3 commits into
envoyproxy:mainfrom
yuminn-k:sds-same-port-peers-disable-h2
Open

yuminn-k wants to merge 3 commits into
envoyproxy:mainfrom
yuminn-k:sds-same-port-peers-disable-h2

Conversation

@yuminn-k

@yuminn-k yuminn-k commented Oct 31, 2026 •

Copy link
Copy Markdown

What this PR does / why we need it:

When an SDS-backed HTTPS listener has an explicit hostname, checkOverlappingCertificates only downgraded same-port peers whose known certificate SANs overlapped that hostname. The SDS certificate is opaque to Envoy Gateway, and nothing requires it to cover only the listener hostname: an SDS server for sds.example.com can return a certificate that also covers foo.example.com. A client can then open an HTTP/2 connection to the SDS listener and coalesce foo.example.com requests onto it, while the foo.example.com listener stays on HTTP/2 because its SANs don't match sds.example.com.

This PR follows the approach in the issue: when two or more valid HTTPS listeners share a port and at least one of them is SDS-backed, every listener on that port gets tlsOverlaps and the existing OverlappingTLSConfig=True / SDSCertificateOpaque condition, unless ALPN is configured explicitly with ClientTrafficPolicy. The SAN-vs-hostname loop is removed, since it no longer changes the result. Listeners on other ports, invalid peers, and a standalone SDS listener are unaffected (the existing test cases for these still pass).

Behavior change to note: with an SDS listener on a shared port, inline-certificate peers with unrelated hostnames now default to HTTP/1.1 where they used to keep HTTP/2.

Commits:

  1. test(gatewayapi): updates the SDS certificate leaves distinct-hostname peers on HTTP/2 case (now SDS certificate disables HTTP/2 on distinct-hostname peers) to expect the condition and tlsOverlaps on all three listeners. It fails on main.
  2. fix(gatewayapi): the fix, the regenerated sds-listener.out.yaml golden file (inline-same-port now gets the condition and tlsOverlaps: true), the TLS termination task docs, and a release note.

Tests:

  • go test ./internal/gatewayapi/... ./internal/xds/... ./internal/cmd/egctl/... pass
  • Golden file regenerated with go test ./internal/gatewayapi -run TestTranslate --override-testdata=true
  • golangci-lint run on ./internal/gatewayapi/ is clean

Release note: release-notes/current/bug_fixes/9697-sds-same-port-peers-http1.md. It is named after the issue number. I can rename it to the PR number if preferred.

AI assistance: this change was prepared with Claude Opus 5.5 (Claude Code).

Which issue(s) this PR fixes:
Fixes #9697


PR Checklist

  • Authorship & ownership: Coding agents / AI assistants are welcome, but I have reviewed every change, understand how and why it works, can explain and maintain it, and take full responsibility for this PR. I have not submitted generated output I do not understand.
  • DCO: All commits are signed off (git commit -s). See DCO: Sign your work.
  • API agreed first: N/A: no API changes.
  • Required checks pass: make generate gen-check, make lint, and the unit-test/coverage build pass. (Flaky e2e failures are not considered breakages, but gen-check, lint, and coverage MUST pass.)
  • Tests added/updated: New/changed code is covered by appropriate tests. N/A if this PR does not contain code changes.
  • Docs: Updated site/content/en/latest/tasks/security/tls-termination.md.
  • Release notes: For any non-trivial change, added a release-note fragment under release-notes/current/<section>/<pr-number>-<slug>.md (see release-notes/current/README.md for sections and naming). N/A if this PR does not contain non-trivial changes.
  • Generated files committed: N/A: no API/helm/module changes.
  • Scope & compatibility: The PR is reasonably scoped (no unrelated changes) and preserves backward compatibility, or any breaking change is called out above and documented in release-notes/current/breaking_changes/.
  • Codex review: Requested a Codex review and addressed all of its comments.
  • Copilot review: Requested a Copilot review and addressed all of its comments.

🤖 Generated with Claude Code

https://claude.ai/code/session_012bPQTxDmyCAwQaT3PtwxBr

🤖 Generated with Claude Code

https://claude.ai/code/session_012bPQTxDmyCAwQaT3PtwxBr

…e-port peer

An SDS server for sds.example.com can return a certificate that also
covers foo.example.com. A client can then coalesce foo.example.com
requests onto an HTTP/2 connection to the SDS listener, so a same-port
peer must not stay on HTTP/2 just because its own SANs do not overlap the
SDS listener hostname.

This test fails until the translator treats every same-port peer of an
SDS-backed listener as overlapping.

Assisted-by: Claude Opus 5.5
Signed-off-by: YuMin Kim <yuminkim.dev@gmail.com>
…tener

When an SDS-backed listener had an explicit hostname, only same-port
peers whose known certificate SANs overlapped that hostname were
downgraded to HTTP/1.1. The SDS certificate is opaque and may cover more
names than the listener hostname, so a client could coalesce requests
for a peer onto an HTTP/2 connection to the SDS listener.

Treat every valid same-port peer of an SDS-backed listener as
overlapping, unless ALPN is configured with ClientTrafficPolicy. The
sds-listener golden output now reports the condition and tlsOverlaps on
inline-same-port, and the TLS termination docs describe the new default.

Fixes envoyproxy#9697

Assisted-by: Claude Opus 5.5
Signed-off-by: YuMin Kim <yuminkim.dev@gmail.com>
@yuminn-k
yuminn-k requested a review from a team as a code owner October 31, 2026 04:06
Assisted-by: Claude Opus 5.5
Signed-off-by: YuMin Kim <yuminkim.dev@gmail.com>
@netlify

netlify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit cee8c94
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6ae5696cc7c8f1b8a6693d8d
😎 Deploy Preview https://deploy-preview-10468--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-31T04:08:06.742862Z
We couldn’t complete this review. Comment @codex review to try again.
6ab031b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
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.

Treat every same-port SDS peer as overlapping

1 participant