-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crypto/tls: improved 0-RTT QUIC APIs #63691
Comments
https://go.dev/cl/536935 contains a draft implementation of this proposal. |
Change https://go.dev/cl/536935 mentions this issue: |
I'll take a closer look at the API later, but I'd like to point out that cloning the
|
Here are a few things I noticed:
|
Does the client need to disable 0-RTT at the TLS layer? It can just choose not to send any 0-RTT packets. That said, I think we can adjust the proposal to both simplify it and address both your points. We change the
We drop the Updated https://go.dev/cl/536935 with these changes. |
Updated the top comment to match the new QUICResumeSession. |
This proposal has been added to the active column of the proposals project |
@neild is the top comment still an accurate definition of the proposal? |
Yes, the top comment is accurate. |
Based on the discussion above, this proposal seems like a likely accept. Proposal is in top comment: #63691 (comment) |
No change in consensus, so accepted. 🎉 Proposal is in top comment: #63691 (comment) |
@neild Is the plan to land this in Go 1.23? |
@marten-seemann Yes, assuming nothing goes awry. |
Change https://go.dev/cl/594475 mentions this issue: |
Go 1.23 adds two new events to QUICConns: QUICStoreSessionEvent and QUICResumeSessionEvent. We added a QUICConfig.EnableStoreSessionEvent flag to control whether the store-session event is provided or not, because receiving this event requires additional action from the caller: the session must be explicitly stored with QUICConn.StoreSession. We did not add a control for whether the resume-session event is provided, because this event requires no action and the caller is expected to ignore unknown events. However, we never documented the expectation that callers ignore unknown events, and quic-go produces an error when receiving an unexpected event. So change the EnableStoreSessionEvent flag to apply to both new events. Fixes #68124 For #63691 Change-Id: I84af487e52b3815f7b648e09884608f8915cd645 Reviewed-on: https://go-review.googlesource.com/c/go/+/594475 Reviewed-by: Marten Seemann <martenseemann@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
Go 1.23 adds two new events to QUICConns: QUICStoreSessionEvent and QUICResumeSessionEvent. We added a QUICConfig.EnableStoreSessionEvent flag to control whether the store-session event is provided or not, because receiving this event requires additional action from the caller: the session must be explicitly stored with QUICConn.StoreSession. We did not add a control for whether the resume-session event is provided, because this event requires no action and the caller is expected to ignore unknown events. However, we never documented the expectation that callers ignore unknown events, and quic-go produces an error when receiving an unexpected event. So change the EnableStoreSessionEvent flag to apply to both new events. Fixes golang#68124 For golang#63691 Change-Id: I84af487e52b3815f7b648e09884608f8915cd645 Reviewed-on: https://go-review.googlesource.com/c/go/+/594475 Reviewed-by: Marten Seemann <martenseemann@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
crypto/tls: improved 0-RTT QUIC APIs
This is a proposal to add additional support for 0-RTT (early data) sessions to
crypto/tls
. This adds additional features on top of #60107 to improve the interactions between the QUIC and TLS layers when resuming sessions with 0-RTT.Background
QUIC connections negotiate a set of shared state, such as limits on the number of streams each peer may create and the amount of data which may be sent on each stream. When resuming a session with 0-RTT, both the QUIC client and server remember these limits. The client must abide by the remembered limits when sending 0-RTT data, and the server may reject 0-RTT if it is no longer willing to abide by the limits from the previous session.
Application protocols running on QUIC may have similar requirements. For example, HTTP/3 clients may remember stored settings such as QPACK limits.
This means that:
It is mostly possible to do this using existing
crypto/tls
APIs, but with some limitations which I'll discuss below. The following proposal avoids those limitations and provides an approach which is more consistent with the existing QUIC support APIs.Proposal
To summarize these changes:
This permits a QUIC implementation to fully manage 0-RTT through the QUICConn event stream.
Motivation
The current
crypto/tls
API does permit a QUIC implementation to support 0-RTT. However, there are limitations to the current approach.A server can use the
Config.WrapSession
andConfig.UnwrapSession
hooks to add and remove additional data from session tickets. A client can use aConfig.ClientSessionCache
wrapper to do the same for stored sessions.In both cases, the QUIC layer needs to take steps to integrate with
WrapSession
,UnwrapSession
, andClientSessionCache
values provided by the user. Users may use these values for offline storage of sessions, or other purposes.Practically, this means that a QUIC implementation which accepts a
tls.Config
from the user will need to clone the config and wrap existingWrapSession
/UnwrapSession
/ClientSessionCache
values. The implementation will need to clone the config for, at a minimum, each server with a unique set of transport parameters and for each client connection.Cloned
tls.Config
s do not share session ticket keys. Cloning a serverConfig
using auto-rotation will cause that server to not share keys or a rotation schedule with the originalConfig
. ForConfig
s using manual key rotation, calls toConfig.SetSessionTicketKeys
on the parentConfig
will not propagate to the clonedConfig
. There are some ways around this problem, but they aren't obvious and will have an impact on the QUIC API.Cloning the client
Config
is less troublesome; I believe all relevant client state can be cloned safely.Less importantly, but still relevant, the current API is cumbersome, difficult to use, and inconsistent. The QUIC API added in #44886 is based on an event loop and synchronous operations. Using
WrapSession
/UnwrapSession
/ClientSessionCache
for ticket management is callback-oriented and asynchronous. This adds a fair amount of mandatory complexity to the QUIC implementation.The proposal here avoids these issues by permitting the QUIC layer to pass through a
tls.Config
from the application unchanged. All necessary interactions between the QUIC and TLS layers are managed through thetls.QUICConn
.The text was updated successfully, but these errors were encountered: