Skip to content

Commit b126ebb

Browse files
committed
feat(mbedtls): new config to allow weak cert verification
1 parent 0291bee commit b126ebb

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

Diff for: components/mbedtls/Kconfig

+7
Original file line numberDiff line numberDiff line change
@@ -1273,4 +1273,11 @@ menu "mbedTLS"
12731273
which is added through vfs component for ESP32 based targets or by
12741274
the host system when the target is Linux.
12751275

1276+
config MBEDTLS_ALLOW_WEAK_CERTIFICATE_VERIFICATION
1277+
bool "Allow weak certificate verification"
1278+
default n
1279+
help
1280+
This options allows weak certificate verification by skipping the hostname verification.
1281+
It is not recommended to use this option.
1282+
12761283
endmenu # mbedTLS

Diff for: components/mbedtls/port/include/mbedtls/esp_config.h

+15
Original file line numberDiff line numberDiff line change
@@ -2117,6 +2117,21 @@
21172117
#undef MBEDTLS_ERROR_C
21182118
#endif
21192119

2120+
/**
2121+
* \def MBEDTLS_SSL_CLI_ALLOW_WEAK_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME
2122+
*
2123+
* Caller: library/ssl_tls.c
2124+
*
2125+
* Allow weak certificate verification without a hostname.
2126+
* This option is not recommended for production use.
2127+
*/
2128+
2129+
#if CONFIG_MBEDTLS_ALLOW_WEAK_CERTIFICATE_VERIFICATION
2130+
#define MBEDTLS_SSL_CLI_ALLOW_WEAK_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME
2131+
#else
2132+
#undef MBEDTLS_SSL_CLI_ALLOW_WEAK_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME
2133+
#endif
2134+
21202135
/**
21212136
* \def MBEDTLS_GCM_C
21222137
*

0 commit comments

Comments
 (0)