diff --git a/library/ssl_tls13_server.c b/library/ssl_tls13_server.c index e1e52cb45..667e596e5 100644 --- a/library/ssl_tls13_server.c +++ b/library/ssl_tls13_server.c @@ -2866,7 +2866,14 @@ static int ssl_tls13_write_new_session_ticket( mbedtls_ssl_context *ssl ) MBEDTLS_SSL_PROC_CHK( mbedtls_ssl_finish_handshake_msg( ssl, buf_len, msg_len ) ); - ssl->handshake->new_session_tickets_count--; + /* Limit session tickets count to one when resumption connection. + * + * See document of mbedtls_ssl_conf_new_session_tickets. + */ + if( ssl->handshake->resume == 1 ) + ssl->handshake->new_session_tickets_count = 0; + else + ssl->handshake->new_session_tickets_count--; mbedtls_ssl_handshake_set_state( ssl, MBEDTLS_SSL_NEW_SESSION_TICKET_FLUSH );