Skip to content

Commit f4306de

Browse files
committed
Force use of TLS 1.3 in OpenSSL demos
1 parent fa50223 commit f4306de

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

platform/posix/transport/src/openssl_posix.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,17 @@ OpensslStatus_t Openssl_Connect( NetworkContext_t * pNetworkContext,
631631
}
632632
}
633633

634+
/* Set minimum TLS version. */
635+
if( returnStatus == OPENSSL_SUCCESS )
636+
{
637+
int ret = SSL_CTX_set_min_proto_version(pSslContext, TLS1_3_VERSION);
638+
if(ret != 1)
639+
{
640+
LogError( ( "Failed to set minimum TLS version to 1.3." ) );
641+
returnStatus = OPENSSL_API_ERROR;
642+
}
643+
}
644+
634645
/* Setup credentials. */
635646
if( returnStatus == OPENSSL_SUCCESS )
636647
{

0 commit comments

Comments
 (0)