diff --git a/components/aws_iot/port/network_mbedtls_wrapper.c b/components/aws_iot/port/network_mbedtls_wrapper.c index 157c78f0..2b078da9 100644 --- a/components/aws_iot/port/network_mbedtls_wrapper.c +++ b/components/aws_iot/port/network_mbedtls_wrapper.c @@ -27,6 +27,7 @@ #include "mbedtls/esp_debug.h" #include "esp_log.h" +#include "esp_system.h" #ifdef CONFIG_USE_VFS #include "esp_vfs.h" @@ -278,8 +279,12 @@ IoT_Error_t iot_tls_connect(Network *pNetwork, TLSConnectParams *params) { ESP_LOGD(TAG, "SSL state connect : %d ", tlsDataParams->ssl.state); ESP_LOGD(TAG, "Performing the SSL/TLS handshake..."); + + rtc_clk_cpu_freq_set(RTC_CPU_FREQ_160M); + while((ret = mbedtls_ssl_handshake(&(tlsDataParams->ssl))) != 0) { if(ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) { + rtc_clk_cpu_freq_set(RTC_CPU_FREQ_80M); ESP_LOGE(TAG, "failed! mbedtls_ssl_handshake returned -0x%x", -ret); if(ret == MBEDTLS_ERR_X509_CERT_VERIFY_FAILED) { ESP_LOGE(TAG, " Unable to verify the server's certificate. "); @@ -288,6 +293,8 @@ IoT_Error_t iot_tls_connect(Network *pNetwork, TLSConnectParams *params) { } } + rtc_clk_cpu_freq_set(RTC_CPU_FREQ_80M); + ESP_LOGD(TAG, "ok [ Protocol is %s ] [ Ciphersuite is %s ]", mbedtls_ssl_get_version(&(tlsDataParams->ssl)), mbedtls_ssl_get_ciphersuite(&(tlsDataParams->ssl))); if((ret = mbedtls_ssl_get_record_expansion(&(tlsDataParams->ssl))) >= 0) { diff --git a/components/esp8266/lib/VERSION b/components/esp8266/lib/VERSION index 28b27b06..4a992db5 100644 --- a/components/esp8266/lib/VERSION +++ b/components/esp8266/lib/VERSION @@ -1,5 +1,5 @@ gwen: - core: 5ce569c + core: 25b7949 net80211: f7214eb pp: cd2eae1 wpa: 4e2372f diff --git a/components/esp8266/lib/libcore.a b/components/esp8266/lib/libcore.a index db3faeb3..c870943f 100644 Binary files a/components/esp8266/lib/libcore.a and b/components/esp8266/lib/libcore.a differ