HTTP/3 (QUIC)
Feature-gated
Build with --features http3 to enable HTTP/3 QUIC support.
Zion supports HTTP/3 over QUIC alongside HTTP/1.1 and HTTP/2 on the same port. QUIC provides built-in encryption (TLS 1.3) and connection migration for mobile clients. Zion runs it without 0-RTT (TLS early data), at boot and after a certificate reload.
How it works
When --features http3 is enabled:
- Zion binds a UDP socket on the same HTTPS port (default
:443) - QUIC connections are handled via the
quinnlibrary - HTTP/3 semantics via the
h3library - The
Alt-Svcheader is automatically injected on HTTP/1.1 and HTTP/2 responses to advertise HTTP/3 availability, in place of anyAlt-Svcthe origin sent (a build without the feature removes the origin's)
http
Alt-Svc: h3=":443"; ma=86400Clients that support HTTP/3 (Chrome, Firefox, Safari, curl 8+) will upgrade automatically.
Build
bash
cargo build --release --features http3
# Combined with other features:
cargo build --release --features "http3,acme,auth"Architecture
text
Client (UDP) ─── QUIC ─── Zion (:443 UDP) ─── HTTP/1.1 ─── Upstream
Client (TCP) ─── TLS ─── Zion (:443 TCP) ─── HTTP/1.1 ─── UpstreamBoth TCP (HTTP/1.1 + HTTP/2) and UDP (HTTP/3) listeners share:
- The same TLS configuration, from boot: the certificate, the
[[tls.sni]]certificates,client_authwith its client CA and CRL, and the session ticket keys. Withclient_auth = "required", a client without a certificate that verifies is refused at the QUIC handshake as at the TCP one, and a verified client certificate reaches the upstream asX-Client-Cert-Fingerprinton both. HTTP/3 carries no JA4. - The same routing table
- The same WAF pipeline
- The same security headers
- The same request header bound: a header section of at most 16 KiB (decoded), as HTTP/1.1 and HTTP/2. HTTP/3 advertises it in its SETTINGS (
SETTINGS_MAX_FIELD_SECTION_SIZE), so a conforming client does not send more, and a request over it gets431.
TLS certificate hot-reload
When certificates are hot-reloaded, both the TCP TLS acceptor and the QUIC configuration are updated simultaneously via a tokio::sync::watch channel. Zero downtime for both protocols.
Limitations
- HTTP/3 uses the same upstream connection pool (HTTP/1.1 to backend)
- WebSocket upgrade is not supported over HTTP/3 (protocol limitation)
io_uringsingle-shot accept applies to TCP only (QUIC uses standard UDP recv)
Dependencies
When http3 feature is enabled:
| Crate | Purpose |
|---|---|
quinn | QUIC transport implementation |
h3 | HTTP/3 protocol semantics |
h3-quinn | Glue between h3 and quinn |
Verification
bash
# Check Alt-Svc header (HTTP/2)
curl -sI https://localhost:443 | grep alt-svc
# Test with HTTP/3 directly (curl 8+)
curl --http3-only https://localhost:443/healthz