Skip to content

Commit 52469c8

Browse files
mahavirjespressif-bot
authored andcommitted
esp-tls: enable TLS renegotiation using explicit API call
mbedTLS stack does not keep TLS renegotiation enabled even if relevant config option is turned on, it needs explicit API call `mbedtls_ssl_conf_renegotiation` to do so. This issue was observed in case of Azure IoT, where keys needs to be refreshed periodically to keep TLS connection intact.
1 parent 0dba932 commit 52469c8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

components/esp-tls/esp_tls_mbedtls.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,9 @@ esp_err_t set_client_config(const char *hostname, size_t hostlen, esp_tls_cfg_t
410410
return ESP_ERR_MBEDTLS_SSL_CONFIG_DEFAULTS_FAILED;
411411
}
412412

413+
#ifdef CONFIG_MBEDTLS_SSL_RENEGOTIATION
414+
mbedtls_ssl_conf_renegotiation(&tls->conf, MBEDTLS_SSL_RENEGOTIATION_ENABLED);
415+
#endif
413416

414417
if (cfg->alpn_protos) {
415418
#ifdef CONFIG_MBEDTLS_SSL_ALPN

0 commit comments

Comments
 (0)