Merge branch 'bugfix/tcp_transport_tls_no_mem_v4.3' into 'release/v4.3'

tcp_transport: Fix error handling of esp_tls_init() (v4.3)

See merge request espressif/esp-idf!13676
This commit is contained in:
David Čermák 2021-06-16 09:50:10 +00:00
commit 3e28c250d7

View File

@ -72,6 +72,10 @@ static int ssl_connect(esp_transport_handle_t t, const char *host, int port, int
ssl->cfg.timeout_ms = timeout_ms;
ssl->ssl_initialized = true;
ssl->tls = esp_tls_init();
if (ssl->tls == NULL) {
ESP_LOGE(TAG, "Failed to initialize new connection object");
return -1;
}
if (esp_tls_conn_new_sync(host, strlen(host), port, &ssl->cfg, ssl->tls) <= 0) {
ESP_LOGE(TAG, "Failed to open a new connection");
esp_transport_set_errors(t, ssl->tls->error_handle);