From 65f0cb11afb92cc9c333158ea467667f2127c9a2 Mon Sep 17 00:00:00 2001 From: Mirko Vogt Date: Tue, 1 Aug 2023 09:59:30 +0000 Subject: [PATCH] extmod/modssl_mbedtls: Ignore err ERR_SSL_RECEIVED_NEW_SESSION_TICKET. It appears a new session ticket being issued by the server right after completed handshake is not uncommon and shouldn't be treated as fatal. mbedtls itself states "This error code is experimental and may be changed or removed without notice." Signed-off-by: Mirko Vogt --- extmod/modssl_mbedtls.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extmod/modssl_mbedtls.c b/extmod/modssl_mbedtls.c index 98baf572e4..449952594c 100644 --- a/extmod/modssl_mbedtls.c +++ b/extmod/modssl_mbedtls.c @@ -443,6 +443,14 @@ STATIC mp_uint_t socket_read(mp_obj_t o_in, void *buf, mp_uint_t size, int *errc // renegotiation. ret = MP_EWOULDBLOCK; o->poll_mask = MP_STREAM_POLL_WR; + #if defined(MBEDTLS_SSL_PROTO_TLS1_3) + } else if (ret == MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET) { + // It appears a new session ticket being issued by the server right after + // completed handshake is not uncommon and shouldn't be treated as fatal. + // mbedtls itself states "This error code is experimental and may be + // changed or removed without notice." + ret = MP_EWOULDBLOCK; + #endif } else { o->last_error = ret; }