Replies: 2 comments 1 reply
-
|
See some interesting discussion about full/half duplex IO here: https://www.bearssl.org/api1.html#io-buffer |
Beta Was this translation helpful? Give feedback.
-
|
Something I wanted to add, s2n-quic currently throws away the s2n-tls connection after using it to perform the TLS handshake (s2n-quic doesn't need it to send/recv encrypted data and the connection is hefty). This caused problems when we added session resumption however, because the session ticket is a post-handshake message, and it's unclear how long you should keep around the s2n_connection so that you can read/send session tickets. If we are deciding to transform the s2n_connection into a minimal struct, I recommend making it able to both send/recv session tickets, so s2n-quic can keep that tiny struct around, instead of the s2n_connection. Just a thought. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
TLS can be thought of in two phases
I haven't previously thought of things in these terms, but I think a lot of our APIs actually mirror this boundary.
s2n_free_handshake: moderately cursed API, reflecting the fact that the connection enters a different mode after handshake completions2nhandshake buffer freeing: we free the handshake IO buffer after completion -> reflecting the different modes2nconnection serialization: anecdotally, this is often used after the handshake. Notably, the connection returned is a "minimal" version which only stores the information required to exchange application data.Proposal
s2n-tls should vend an
s2n_data_connectionwhich is only used for writing/reading application data. This should be implemented entirely in rust.I imagine this as a fairly low-level primitive which would have the following benefit
s2n_data_connectionshould allow customers to control the buffering, like the Rustls unbuffered connection.The
sloppiesteasiest way to implement a prototype would probably be to just steal the stuff from a serialized connection.Beta Was this translation helpful? Give feedback.
All reactions