From cd03c0cc22cc0e1322aa4a84f016b808985f9d14 Mon Sep 17 00:00:00 2001 From: Supreet Deshpande Date: Thu, 9 Jan 2020 15:55:52 +0530 Subject: [PATCH] bugfix/tls_handshake: Fixed an error check during TLS handshake. (cherry picked from commit fb8b45cf0665d7cca1415430a22c1d74d17d9827) --- components/aws_iot/port/network_mbedtls_wrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/aws_iot/port/network_mbedtls_wrapper.c b/components/aws_iot/port/network_mbedtls_wrapper.c index 5b70ad30..131336db 100644 --- a/components/aws_iot/port/network_mbedtls_wrapper.c +++ b/components/aws_iot/port/network_mbedtls_wrapper.c @@ -107,7 +107,7 @@ IoT_Error_t iot_tls_connect(Network *pNetwork, TLSConnectParams *params) { ret = SSL_CONNECTION_ERROR; } else { int tls_ret = esp_tls_conn_new_sync(pNetwork->tlsConnectParams.pDestinationURL, strlen(pNetwork->tlsConnectParams.pDestinationURL), pNetwork->tlsConnectParams.DestinationPort, &cfg, tls); - if (tls_ret) { + if (tls_ret == -1) { ret = SSL_CONNECTION_ERROR; esp_tls_conn_delete(tls); }