Config: Add error message if certbunde is not enabled

Merges https://github.com/espressif/esp-mqtt/pull/198
This commit is contained in:
David Cermak
2021-09-07 15:38:20 +02:00
parent 4a89bff610
commit 1b71980575

View File

@ -204,15 +204,18 @@ static esp_err_t esp_mqtt_set_ssl_transport_properties(esp_transport_list_handle
if (cfg->use_global_ca_store == true) {
esp_transport_ssl_enable_global_ca_store(ssl);
#ifdef CONFIG_MBEDTLS_CERTIFICATE_BUNDLE
} else if (cfg->crt_bundle_attach != NULL) {
#ifdef MQTT_SUPPORTED_FEATURE_CERTIFICATE_BUNDLE
#ifdef MQTT_SUPPORTED_FEATURE_CERTIFICATE_BUNDLE
#ifdef CONFIG_MBEDTLS_CERTIFICATE_BUNDLE
esp_transport_ssl_crt_bundle_attach(ssl, cfg->crt_bundle_attach);
#else
#else
ESP_LOGE(TAG, "Certificate bundle is not enabled for mbedTLS in menuconfig");
goto esp_mqtt_set_transport_failed;
#endif /* CONFIG_MBEDTLS_CERTIFICATE_BUNDLE */
#else
ESP_LOGE(TAG, "Certificate bundle feature is not available in IDF version %s", IDF_VER);
goto esp_mqtt_set_transport_failed;
#endif
#endif
#endif /* MQTT_SUPPORTED_FEATURE_CERTIFICATE_BUNDLE */
} else {
ESP_OK_CHECK(TAG, esp_mqtt_set_cert_key_data(ssl, MQTT_SSL_DATA_API_CA_CERT, cfg->cacert_buf, cfg->cacert_bytes),
goto esp_mqtt_set_transport_failed);