Skip to content

Commit

Permalink
extmod/modssl_mbedtls.c: do not treat MBEDTLS_ERR_SSL_RECEIVED_NEW_SE…
Browse files Browse the repository at this point in the history
…SSION_TICKET as fatal

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 <mirko-dev|mpy@nanl.de>
  • Loading branch information
Mirko Vogt authored and Mirko Vogt committed Aug 1, 2023
1 parent a4fce45 commit 1d7a9eb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions extmod/modssl_mbedtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,12 @@ 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;
} 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;
} else {
o->last_error = ret;
}
Expand Down

0 comments on commit 1d7a9eb

Please sign in to comment.