quic: add TLS session ticket resumption support #42734
Open
+358
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Commit Message: quic: add session ticket resumption support using configured session ticket keys
Additional Description:
Summary
TLS session resumption is essential for QUIC performance. Without it, every connection requires a full TLS handshake, and 0-RTT becomes meaningless since there's no session state to resume from. As noted in #42682, TLS-related data accounts for roughly 1/3 of bytes during connection establishment - session resumption eliminates most of this overhead.
Currently, Envoy's QUIC implementation does not support session resumption across workers or processes. While users can configure
session_ticket_keysorsession_ticket_keys_sds_secret_configin downstream TLS context, these settings have no effect on QUIC connections. This limitation is documented in #25418, which explicitly states that session ticket key plumbing is missing from the QUIC implementation.This PR bridges that gap by enabling QUIC to use the same session ticket keys configured for TCP TLS, allowing session resumption to work across workers and processes.
Implementation
We create a custom
EnvoyTlsServerHandshakerthat extends QUICHE'sTlsServerHandshakerand providesEnvoyProofSourceHandleto pass filter chain context during certificate selection.Note: QUICHE's
DefaultProofSourceHandleis a private nested class insideTlsServerHandshaker, so we cannot extend or reuse it directly. We had to copy the relevant implementation and add our customizations.Key design decisions:
SSL ex_data for context passing: During
SelectCertificate(), we store the filter chain pointer in SSL ex_data. This allows the session ticket callback to retrieve per-connection configuration.SSL_CTX_set_tlsext_ticket_key_cboverSSL_CTX_set_ticket_aead_method: We use the same callback mechanism as TCP TLS rather than QUICHE'sTicketCrypterinterface. This allows us to reuseServerContextImpl::sessionTicketProcess()directly, ensuring identical session ticket handling between TCP and QUIC.Respect existing configuration: We check
disable_stateless_session_resumption,session_ticket_keys, andhandles_session_resumptionfrom the transport socket factory and disable tickets accordingly viaSSL_OP_NO_TICKET.Flow
Risk Level: Low (behind runtime guard, disabled by default)
Testing: Existing tests, manual verification with QUIC clients
Docs Changes: N/A
Release Notes: Added
Platform Specific Features: N/A
[Optional Runtime guard:]
envoy.reloadable_features.quic_session_ticket_support(default: false)[Optional Fixes #Issue] Partially addresses #25418