esp_http_client: add support for using certs from global ca store

Closes https://github.com/espressif/esp-idf/issues/3062

(cherry picked from commit 27e00cf7aa)
This commit is contained in:
Mahavir Jain
2019-02-20 12:48:45 +05:30
parent 225bc0f80a
commit 2549951498
5 changed files with 22 additions and 4 deletions

View File

@@ -35,9 +35,9 @@ esp_err_t esp_https_ota(const esp_http_client_config_t *config)
return ESP_ERR_INVALID_ARG;
}
if (!config->cert_pem) {
ESP_LOGE(TAG, "Server certificate not found in esp_http_client config");
return ESP_FAIL;
if (!config->cert_pem && !config->use_global_ca_store) {
ESP_LOGE(TAG, "Server certificate not found, either through configuration or global CA store");
return ESP_ERR_INVALID_ARG;
}
esp_http_client_handle_t client = esp_http_client_init(config);