Statistics: Posted by janav1 — Fri Apr 23, 2021 3:09 pm
Code:
<ESC>[0;31mE (127251) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x4c<ESC>[0m<CR><LF>
<ESC>[0;31mE (127255) esp-tls: Failed to open new connection<ESC>[0m<CR><LF>
<ESC>[0;31mE (127258) TRANS_SSL: Failed to open a new connection<ESC>[0m<CR><LF>
<ESC>[0;31mE (127269) HTTP_CLIENT: Connection failed, sock < 0<ESC>[0m<CR><LF>
<ESC>[0;31mE (127274) HTTPS: Error perform http request ESP_ERR_HTTP_CONNECT<ESC>[0m<CR><LF>Code:
esp_http_client_config_t config = {
.host = "https://www.howsmyssl.com",
.path = "/a/check",
.transport_type = HTTP_TRANSPORT_OVER_SSL,
.event_handler = _http_event_handler,
};
esp_http_client_handle_t client = esp_http_client_init(&config);
esp_err_t err = esp_http_client_perform(client);
if (err == ESP_OK) {
int sc = esp_http_client_get_status_code(client);
ESP_LOGI(TAG, "HTTPS Status = %d, content_length = %d", sc, esp_http_client_get_content_length(client));
if(sc == 200){
esp_http_client_read_response(client, post_data, 512);
}
} else {
ESP_LOGE(TAG, "Error perform http request %s", esp_err_to_name(err));
}
esp_http_client_cleanup(client);
Statistics: Posted by janav1 — Tue Dec 29, 2020 4:32 pm