Skip to content

[gateway] forward-port dynamic forward proxy h2/h2c upstream support with auto_sni#88

Merged
dilyevsky merged 1 commit into
mainfrom
dsky/dfp-h2-upstream-auto-sni
Jun 16, 2026
Merged

[gateway] forward-port dynamic forward proxy h2/h2c upstream support with auto_sni#88
dilyevsky merged 1 commit into
mainfrom
dsky/dfp-h2-upstream-auto-sni

Conversation

@dilyevsky

Copy link
Copy Markdown
Contributor

What

Forward-ports the dynamic forward proxy (DFP) improvements that shipped on the v0.11.x release line to maincorrect from the start:

  • Speak HTTP/2 upstream for h2/h2c Backends by emitting HttpProtocolOptions on the dynamic_forward_proxy cluster (was HTTP/1.1 only, defeating multiplexing and making the upstream connection cap easy to hit).
  • Remove Envoy's implicit 1024 max_connections/max_requests cap on http and dfp clusters via explicit circuit breakers.
  • Set auto_sni and auto_san_validation on the DFP cluster's HttpProtocolOptions. Envoy's dynamic_forward_proxy factory requires both once typed_extension_protocol_options are present, otherwise the cluster is rejected with dynamic_forward_proxy cluster must have auto_sni and auto_san_validation true unless allow_insecure_cluster_options is set. This derives upstream SNI from the dynamically resolved host and validates the cert SAN against it — preserving TLS verification, no allow_insecure_cluster_options.

Why

These commits (fee0145, b4dcd07) were authored 2026-06-03 for the NetworkingProd1 incident (dfp-backend-0e058897 rejected; /phone-number/* latency from upstream connection saturation) directly on the v0.11.x release branch, which diverged from main on 2025-10-01. They were never forward-ported — so main still spoke HTTP/1.1 to DFP upstreams. The auto_sni fix is what shipped as v0.11.23; bundling it here means the feature lands on main without ever reintroducing the rejection.

Tests

pkg/gateway/xds/translator/dynamic_forward_proxy_test.go reproduces the production backend (protocol: h2, dnsLookupFamily: v4_only, system-trust TLS) and asserts the generated cluster carries auto_sni + auto_san_validation + HTTP/2 + a TLS socket; covers h2c, plain-HTTP/1.1, and TLS-only-HTTP/1.1; plus a non-DFP scoping guard proving non-DFP cluster output is unchanged. Proven red without the fix, green with it.

🤖 Generated with Claude Code

…with auto_sni

These DFP improvements shipped on the v0.11.x release line (authored 2026-06-03
for the NetworkingProd1 incident) but were never forward-ported to main, which
diverged from that line on 2025-10-01. This brings them to main, correct from
the start:

- Speak HTTP/2 upstream for h2/h2c Backends by emitting HttpProtocolOptions on
  the dynamic_forward_proxy cluster (previously HTTP/1.1 only, which defeated
  multiplexing and made the upstream connection cap easy to hit).
- Remove Envoy's implicit 1024 max_connections/max_requests cap on http and dfp
  clusters via explicit circuit breakers.
- Set auto_sni and auto_san_validation on the DFP cluster's HttpProtocolOptions.
  Envoy's dynamic_forward_proxy factory requires both once
  typed_extension_protocol_options are present (otherwise the cluster is
  rejected: "dynamic_forward_proxy cluster must have auto_sni and
  auto_san_validation true ..."). This derives the upstream SNI from the
  dynamically resolved host and validates the cert SAN against it, preserving
  TLS verification without allow_insecure_cluster_options.

Forward-port of fee0145 + b4dcd07 plus the auto_sni fix shipped in v0.11.23.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dilyevsky dilyevsky merged commit d2e74a1 into main Jun 16, 2026
1 check passed
@dilyevsky dilyevsky deleted the dsky/dfp-h2-upstream-auto-sni branch June 16, 2026 07:36
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.

1 participant