Repository navigation
Description
Description
UpstreamTlsContext.auto_host_sni is ignored when the context is wrapped in QuicUpstreamTransport. An HTTP/3 upstream connection sends no SNI, or the configured sni, instead of the upstream host's hostname. Envoy's QUIC client then checks the server certificate against that name, so the handshake fails whenever the certificate only carries the host's hostname.
Over TLS over TCP, ClientContextImpl::newSsl picks the SNI through effectiveSni: the per-request server name override, then the host's hostname when auto_host_sni is set, then the configured sni. The HTTP/3 pool picks it in sni() in source/common/http/http3/conn_pool.cc, which only looks at the override and the configured sni:
return options && options->serverNameOverride().has_value()
? options->serverNameOverride().value()
: getConfig(host->transportSocketFactory()).serverNameIndication();The pool is created per host and already receives it, so it could apply the same order as effectiveSni.
The auto_host_sni docs and the QuicUpstreamTransport docs don't mention this limitation. Found while adding upstream HTTP/3 to Envoy Gateway, envoyproxy/gateway#10068, where a Backend using autoSNIFromEndpointHostname works over TCP but fails over HTTP/3.
Repro
Envoy 1.35.2, Caddy 2.8 serving HTTP/3 on 8443 with a certificate for h3-backend. Cluster with explicit_http_config.http3_protocol_options:
load_assignment:
cluster_name: always
endpoints:
- lb_endpoints:
- endpoint:
hostname: h3-backend
address: {socket_address: {address: localhost, port_value: 8443}}
transport_socket:
name: envoy.transport_sockets.quic
typed_config:
"@type": type.googleapis.com/envoy.extensions.transport_sockets.quic.v3.QuicUpstreamTransport
upstream_tls_context:
common_tls_context: {}
auto_host_sni: trueEvery request gets a 503:
QUIC_TLS_CERTIFICATE_UNKNOWN with details: TLS handshake failure (ENCRYPTION_HANDSHAKE) 46: certificate unknown
Cert chain verification failed: Leaf certificate doesn't match hostname:
The same UpstreamTlsContext on an envoy.transport_sockets.tls socket, with a trusted CA and auto_sni_san_validation: true, connects and validates the certificate against h3-backend.
Expected
The HTTP/3 pool uses the upstream host's hostname as the SNI when auto_host_sni is set, the same way TLS over TCP does.
Activity
agrawroh commentedon Oct 12, 2026
/assign @agrawroh
quic: apply auto_host_sni to upstream HTTP/3 connections (#48241)