Skip to content

Commit f5b62fa

Browse files
committed
Fix error handling for hostname checking
1 parent e491e1a commit f5b62fa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

platform/posix/transport/src/openssl_posix.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,12 @@ static OpensslStatus_t tlsHandshake( OpensslParams_t * pOpensslParams,
244244
{
245245
/* Validate the hostname against the server's certificate. */
246246
sslStatus = SSL_set1_host( pOpensslParams->pSsl, pOpensslCredentials->certHostName );
247-
}
248247

249-
if( sslStatus != 1 )
250-
{
251-
LogError( ( "SSL_set1_host failed to set the hostname to validate." ) );
252-
returnStatus = OPENSSL_API_ERROR;
248+
if( sslStatus != 1 )
249+
{
250+
LogError( ( "SSL_set1_host failed to set the hostname to validate." ) );
251+
returnStatus = OPENSSL_API_ERROR;
252+
}
253253
}
254254

255255
/* Enable SSL peer verification. */

0 commit comments

Comments
 (0)