Added timeout to SSL handshake in transport_mbedtls.c (#1405)
CI Checks / git-secrets (push) Has been cancelled
CI Checks / formatting (push) Has been cancelled
CI Checks / spell-check (push) Has been cancelled
CI Checks / doxygen (push) Has been cancelled
CI Checks / verify-manifest (push) Has been cancelled
CI Checks / memory-statistics (push) Has been cancelled
CI Checks / proof_ci (push) Has been cancelled
FreeRTOS Demos / WIN32 MSVC (push) Has been cancelled
FreeRTOS Demos / WIN32 MingW (push) Has been cancelled
FreeRTOS Demos / Posix GCC (push) Has been cancelled
FreeRTOS Demos / GNU MSP430 Toolchain (push) Has been cancelled
FreeRTOS Demos / GNU ARM Toolchain (push) Has been cancelled
FreeRTOS MPU Demo / TI-Hercules RM46 and RM57 MPU Demos (push) Has been cancelled
Build FreeRTOS+ Demos / Windows Simulator Cellular Demos (push) Has been cancelled
Build FreeRTOS+ Demos / coreHTTP WinSim Demos (push) Has been cancelled
Build FreeRTOS+ Demos / corePKCS11 WinSim Demos (push) Has been cancelled
Build FreeRTOS+ Demos / core Library Windows Simulator Demos (push) Has been cancelled
Build FreeRTOS+ Demos / AWS IoT Windows Simulator Demos (push) Has been cancelled
Build FreeRTOS+ Demos / FreeRTOS+TCP Posix Simulator Demo (push) Has been cancelled
Build FreeRTOS+ Demos / FreeRTOS+TCP QEMU ARM MPS2 AN385 (push) Has been cancelled
Build FreeRTOS+ Demos / FreeRTOS+TCP Windows Simulator Demos (push) Has been cancelled
Build FreeRTOS+ Demos / FreeRTOS+CLI Windows Simulator Demos (push) Has been cancelled
Kernel Unit Tests / FreeRTOS/Source Submodule Revision (push) Has been cancelled
Kernel Unit Tests / FreeRTOS-Kernel Main Branch (push) Has been cancelled

* Added timeout to SSL handshake in transport_mbedtls.c

---------

Co-authored-by: Aniruddha Kanhere <kanherea@amazon.com>
This commit is contained in:
Christian Jensen
2026-04-23 20:16:18 +00:00
committed by GitHub
co-authored by Aniruddha Kanhere
parent 675335bf6a
commit 1495a812e4
@@ -599,11 +599,16 @@ static TlsTransportStatus_t tlsHandshake( NetworkContext_t * pNetworkContext,
if( returnStatus == TLS_TRANSPORT_SUCCESS )
{
/* Perform the TLS handshake. */
TickType_t handshakeTimeoutTicks = pdMS_TO_TICKS( 10000 );
TimeOut_t handshakeStart;
vTaskSetTimeOutState( &handshakeStart );
do
{
mbedtlsError = mbedtls_ssl_handshake( &( pTlsTransportParams->sslContext.context ) );
} while( ( mbedtlsError == MBEDTLS_ERR_SSL_WANT_READ ) ||
( mbedtlsError == MBEDTLS_ERR_SSL_WANT_WRITE ) );
} while( ( ( mbedtlsError == MBEDTLS_ERR_SSL_WANT_READ ) ||
( mbedtlsError == MBEDTLS_ERR_SSL_WANT_WRITE ) ) &&
( xTaskCheckForTimeOut( &handshakeStart, &handshakeTimeoutTicks ) == pdFALSE ) );
if( mbedtlsError != 0 )
{