From 49ce8d3fe5e42b247a8466b1400fc4299bb2e55a Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Wed, 15 Apr 2020 15:22:32 +0530 Subject: [PATCH] transport_ssl: reset state on connection closure For url redirection cases (HTTP status 301/302), internal transport ssl connection state must be reinitialized for successful (new) connection on updated url. Closes https://github.com/espressif/esp-idf/issues/4598 --- components/tcp_transport/transport_ssl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/tcp_transport/transport_ssl.c b/components/tcp_transport/transport_ssl.c index 4bca105d47..23c2b09440 100644 --- a/components/tcp_transport/transport_ssl.c +++ b/components/tcp_transport/transport_ssl.c @@ -171,6 +171,7 @@ static int ssl_close(esp_transport_handle_t t) transport_ssl_t *ssl = esp_transport_get_context_data(t); if (ssl->ssl_initialized) { esp_tls_conn_delete(ssl->tls); + ssl->conn_state = TRANS_SSL_INIT; ssl->ssl_initialized = false; } return ret;