背景
使用ESP32通过网络api获取天气等信息时,出现了错误:
W (21534) Weather: request_url: https://devapi.qweather.com/v7/weather/7d?xxx
E (21584) esp-tls-mbedtls: No server verification option set in esp_tls_cfg_t structure. Check esp_tls API reference
E (21584) esp-tls-mbedtls: Failed to set client configurations, returned [0x8017] (ESP_ERR_MBEDTLS_SSL_SETUP_FAILED)
E (21594) esp-tls: create_ssl_handle failed
E (21604) esp-tls: Failed to open new connection
E (21604) transport_base: Failed to open a new connection
E (21614) HTTP_CLIENT: Connection failed, sock < 0
E (21614) Weather: Failed to open HTTP connection: ESP_ERR_HTTP_CONNECT
解决办法
在 setting 中,勾选上这两项: