From ce498462f745a3272470bf210e85fe680b04de3f Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Sat, 6 Feb 2016 17:12:46 +0200 Subject: [PATCH 1/2] Fix secure TCP connections Call `espconn_secure_set_size()` before calling `esp_secure_connect()`, should fix issues like #710 and #520 --- app/modules/net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/app/modules/net.c b/app/modules/net.c index 516ccab9..faab54de 100644 --- a/app/modules/net.c +++ b/app/modules/net.c @@ -594,6 +594,7 @@ static void socket_connect(struct espconn *pesp_conn) { #ifdef CLIENT_SSL_ENABLE if(nud->secure){ + espconn_secure_set_size(ESPCONN_CLIENT, 5120); /* set SSL buffer size */ espconn_secure_connect(pesp_conn); } else From 31a62a9eb1b5fadd12940ec1886dd9f8b515a8d9 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Sun, 7 Feb 2016 18:11:30 +0200 Subject: [PATCH 2/2] Fix secure MQTT connections Call `espconn_secure_set_size()` before calling `espconn_secure_connect()`, similar to how the http module works --- app/modules/mqtt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/modules/mqtt.c b/app/modules/mqtt.c index 2b6a35b3..c3d7b131 100644 --- a/app/modules/mqtt.c +++ b/app/modules/mqtt.c @@ -821,7 +821,8 @@ static sint8 socket_connect(struct espconn *pesp_conn) #ifdef CLIENT_SSL_ENABLE if(mud->secure) { - espconn_status = espconn_secure_connect(pesp_conn); + espconn_secure_set_size(ESPCONN_CLIENT, 5120); /* set SSL buffer size */ + espconn_status = espconn_secure_connect(pesp_conn); } else #endif