mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2025-05-17 15:06:34 +08:00
Update network_transport files based on MbedTLSv3.6.3 (#1340)
Update network_transport files based on MbedTLSv3.6.3
This commit is contained in:
@ -462,13 +462,19 @@ static void setOptionalConfigurations( SSLContext_t * pSslContext,
|
||||
{
|
||||
mbedtlsError = mbedtls_ssl_set_hostname( &( pSslContext->context ),
|
||||
pHostName );
|
||||
}
|
||||
/* MbedTLS-3.6.3 requires calling the mbedtls_ssl_set_hostname() before calling mbedtls_ssl_handshake(). */
|
||||
else
|
||||
{
|
||||
mbedtlsError = mbedtls_ssl_set_hostname( &( pSslContext->context ),
|
||||
NULL );
|
||||
}
|
||||
|
||||
if( mbedtlsError != 0 )
|
||||
{
|
||||
LogError( ( "Failed to set server name: mbedTLSError= %s : %s.",
|
||||
mbedtlsHighLevelCodeOrDefault( mbedtlsError ),
|
||||
mbedtlsLowLevelCodeOrDefault( mbedtlsError ) ) );
|
||||
}
|
||||
if( mbedtlsError != 0 )
|
||||
{
|
||||
LogError( ( "Failed to set server name: mbedTLSError= %s : %s.",
|
||||
mbedtlsHighLevelCodeOrDefault( mbedtlsError ),
|
||||
mbedtlsLowLevelCodeOrDefault( mbedtlsError ) ) );
|
||||
}
|
||||
|
||||
/* Set Maximum Fragment Length if enabled. */
|
||||
|
@ -463,15 +463,21 @@ static TlsTransportStatus_t tlsSetup( NetworkContext_t * pNetworkContext,
|
||||
{
|
||||
mbedtlsError = mbedtls_ssl_set_hostname( &( pTlsTransportParams->sslContext.context ),
|
||||
pHostName );
|
||||
}
|
||||
/* MbedTLS-3.6.3 requires calling the mbedtls_ssl_set_hostname() before calling mbedtls_ssl_handshake(). */
|
||||
else
|
||||
{
|
||||
mbedtlsError = mbedtls_ssl_set_hostname( &( pTlsTransportParams->sslContext.context ),
|
||||
NULL );
|
||||
}
|
||||
|
||||
if( mbedtlsError != 0 )
|
||||
{
|
||||
LogError( ( "Failed to set server name: mbedTLSError= %s : %s.",
|
||||
mbedtlsHighLevelCodeOrDefault( mbedtlsError ),
|
||||
mbedtlsLowLevelCodeOrDefault( mbedtlsError ) ) );
|
||||
if( mbedtlsError != 0 )
|
||||
{
|
||||
LogError( ( "Failed to set server name: mbedTLSError= %s : %s.",
|
||||
mbedtlsHighLevelCodeOrDefault( mbedtlsError ),
|
||||
mbedtlsLowLevelCodeOrDefault( mbedtlsError ) ) );
|
||||
|
||||
returnStatus = TLS_TRANSPORT_INTERNAL_ERROR;
|
||||
}
|
||||
returnStatus = TLS_TRANSPORT_INTERNAL_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user