Skip to content

auto_host_sni is not applied to upstream HTTP/3 (QUIC) connections #48218

Closed

Description

@zhaohuabing

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: true

Every 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

  1. agrawroh commented on Oct 12, 2026

    @agrawroh
    Member

    /assign @agrawroh

  2. added a commit that references this issue on Oct 13, 2026
    3a8473c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions