diff --git a/components/esp_modem/test/target_ota/components/manual_ota/manual_ota.cpp b/components/esp_modem/test/target_ota/components/manual_ota/manual_ota.cpp index c78c9b4e4..d2c6e2e10 100644 --- a/components/esp_modem/test/target_ota/components/manual_ota/manual_ota.cpp +++ b/components/esp_modem/test/target_ota/components/manual_ota/manual_ota.cpp @@ -35,6 +35,10 @@ bool manual_ota::begin() esp_transport_handle_t tcp = esp_transport_tcp_init(); ssl_ = esp_transport_batch_tls_init(tcp, max_buffer_size_); http_.config_.transport = ssl_; + if (http_.config_.cert_pem == nullptr || common_name_ == nullptr) { + ESP_LOGE(TAG, "TLS with no verification is not supported"); + return fail(); + } if (!esp_transport_batch_set_ca_cert(ssl_, http_.config_.cert_pem, 0)) { return fail(); } diff --git a/components/esp_modem/test/target_ota/components/manual_ota/manual_ota.hpp b/components/esp_modem/test/target_ota/components/manual_ota/manual_ota.hpp index baa1302a9..1e5d87483 100644 --- a/components/esp_modem/test/target_ota/components/manual_ota/manual_ota.hpp +++ b/components/esp_modem/test/target_ota/components/manual_ota/manual_ota.hpp @@ -40,7 +40,7 @@ public: /** * @brief Set common name of the server to verify */ - const char *common_name_; + const char *common_name_{}; /** * @brief Wrapper around the http client -- Please set the http config */