-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
How to handle TLS 1.3 new session ticket errors #8749
Comments
When TLSv1.3 and session tickets are enabled mbedtls_ssl_read() will return an error code to inform about a received session ticket. This can simply be handled like EAGAIN instead of errornously aborting the connection. ref: Mbed-TLS/mbedtls#8749
When TLSv1.3 and session tickets are enabled mbedtls_ssl_read() will return an error code to inform about a received session ticket. This can simply be handled like EAGAIN instead of errornously aborting the connection. ref: Mbed-TLS/mbedtls#8749
When TLSv1.3 and session tickets are enabled mbedtls_ssl_read() will return an error code to inform about a received session ticket. This can simply be handled like EAGAIN instead of errornously aborting the connection. ref: Mbed-TLS/mbedtls#8749
When TLSv1.3 and session tickets are enabled mbedtls_ssl_read() will return an error code to inform about a received session ticket. This can simply be handled like EAGAIN instead of errornously aborting the connection. ref: Mbed-TLS/mbedtls#8749
When TLSv1.3 and session tickets are enabled mbedtls_ssl_read() will return an error code to inform about a received session ticket. This can simply be handled like EAGAIN instead of errornously aborting the connection. ref: Mbed-TLS/mbedtls#8749 Signed-off-by: Anton Khirnov <[email protected]>
When TLSv1.3 and session tickets are enabled mbedtls_ssl_read() will return an error code to inform about a received session ticket. This can simply be handled like EAGAIN instead of errornously aborting the connection. ref: Mbed-TLS/mbedtls#8749 Signed-off-by: Anton Khirnov <[email protected]> Signed-off-by: Paul B Mahol <[email protected]>
As of Mbed TLS 3.2–3.5, the error code is (very tersely) documented but its effect on a TLS connection is not. So applications should terminate the connection, since any error invalidates the In Mbed TLS 3.6.0, we enabled TLS 1.3 by default. So even applications that have no explicit support for TLS 1.3 receive this error. For backward compatibility, we have to stop returning this error by default. Our plan for Mbed TLS 3.6.1 is that this error will never be returned in the default configuration of an SSL context. This means that NewSessionTicket messages after the handshake will be ignored. Applications can declare that support for NewSessionTicket messages by calling a setup function on the SSL context (or the SSL configuration?) before the handshake. This will be a boolean, or maybe registering a callback. |
I think this error can be ignored from Note that while the API allows you to directly call |
For the record, here's my reasoning about which public functions can return
So, long story short, the public functions that might return
|
It's been a while but I remember distinctly to have seen this error in a If that helps, since this bug was reported I followed the suggestion of ignoring I agree with with the proposed path forward to make this opt-in so it doesn't break existing applications. |
In Mbed TLS 3.6.1In #9507 we added documentation on handling the error. We also made a backward-incompatible change for applications that were already handling the error: it is now disabled by default, you'll need to call In Mbed TLS 4.0We're going to change the API: instead of returning an error, the TLS layer will call a callback when it receives a NewSessionTicket message. This was previously suggested in #6640. |
ITYM pre-3.6.1 here. |
If "handling the error" here is just ignoring it and retrying, apps will continue to work, am I correct? We just won't receive the error anymore? |
Right. Applications that want the session tickets will need to call |
This is fixed in Mbed TLS 3.6.1 which has now been released. However I'm not closing this ticket as the following work remains:
|
TLS 1.3 session tickets require additional handling in the client. Mbed-TLS#8749 Disable session tickets for ssl_client1 when using TLS 1.3 until Mbed-TLS#6640 is resolved and (if relevant) implemented in ssl_client1. Signed-off-by: Gilles Peskine <[email protected]>
Closing this issue as the problem was fixed in 3.6.1 and while it has not been resolved for 4.0 yet, that part is already tracked by #6640 which has now been added to the 4.0 board. |
Lately I've been seeing some failed connection in TLS1.3 with mbedtls v3.3 because I was getting a MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET returned from a mbedtls_ssl_write() call.
According to the API doc write() should lead to a reset whenever an error different from WANT_READ, WANT_WRITE, ASYNC_IN, CRYPTO_IN_PROGRESS or CLIENT_RECONNECT is received. So the app was rightfully closing the connection with the new session ticket error. Note that this was both with session tickets enabled and disabled client side.
The only documentation I found about this error just says it's experimental and may go away but says nothing as far as I could find about how to handle it.
Now reading here and there it seems it is indeed safe to ignore this error, at least in mbedtls_ssl_handshake_step(), mbedtls_ssl_handshake() and mbedtls_ssl_read()) according to this comment.
Unfortunately mbedtls_ssl_write is not included in that list so it's still not conclusive about how to handle it in this case.
I'd say if this error is going to stay in future releases it deserves to be better documented.
Edit (mpg): status summary.
The text was updated successfully, but these errors were encountered: