From e08775bfd2d6a74326f917b9a24b47150d03f856 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Wed, 24 Sep 2025 10:52:14 +0100 Subject: [PATCH] - use mbedtls_ssl_set_hostname to disable mandatory hostname checks in newer versions of mbedtls --- hal/tls/mbedtls/tls_mbedtls.c | 4 +++- hal/tls/mbedtls3/tls_mbedtls.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hal/tls/mbedtls/tls_mbedtls.c b/hal/tls/mbedtls/tls_mbedtls.c index e4feb5c4..6648e6f6 100644 --- a/hal/tls/mbedtls/tls_mbedtls.c +++ b/hal/tls/mbedtls/tls_mbedtls.c @@ -3,7 +3,7 @@ * * TLS API for TCP/IP protocol stacks * - * Copyright 2017-2024 Michael Zillgith + * Copyright 2017-2025 Michael Zillgith * * Implementation of the TLS abstraction layer for mbedtls * @@ -943,6 +943,8 @@ TLSSocket_create(Socket socket, TLSConfiguration configuration, bool storeClient } } + mbedtls_ssl_set_hostname(&(self->ssl), NULL); + while( (ret = mbedtls_ssl_handshake(&(self->ssl)) ) != 0 ) { if( ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE ) diff --git a/hal/tls/mbedtls3/tls_mbedtls.c b/hal/tls/mbedtls3/tls_mbedtls.c index ced463ac..48c9abec 100644 --- a/hal/tls/mbedtls3/tls_mbedtls.c +++ b/hal/tls/mbedtls3/tls_mbedtls.c @@ -3,7 +3,7 @@ * * TLS API for TCP/IP protocol stacks * - * Copyright 2017-2024 Michael Zillgith + * Copyright 2017-2025 Michael Zillgith * * Implementation of the TLS abstraction layer for mbedtls * @@ -1036,6 +1036,8 @@ TLSSocket_create(Socket socket, TLSConfiguration configuration, bool storeClient } } + mbedtls_ssl_set_hostname(&(self->ssl), NULL); + while ((ret = mbedtls_ssl_handshake(&(self->ssl))) != 0) { if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE)