Skip to content

Commit 1dc4299

Browse files
committed
fix(modem): Fixed OTA test to gracefully fail with no verification
1 parent ce7dadd commit 1dc4299

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

components/esp_modem/test/target_ota/components/manual_ota/manual_ota.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ bool manual_ota::begin()
3535
esp_transport_handle_t tcp = esp_transport_tcp_init();
3636
ssl_ = esp_transport_batch_tls_init(tcp, max_buffer_size_);
3737
http_.config_.transport = ssl_;
38+
if (http_.config_.cert_pem == nullptr || common_name_ == nullptr) {
39+
ESP_LOGE(TAG, "TLS with no verification is not supported");
40+
return fail();
41+
}
3842
if (!esp_transport_batch_set_ca_cert(ssl_, http_.config_.cert_pem, 0)) {
3943
return fail();
4044
}

components/esp_modem/test/target_ota/components/manual_ota/manual_ota.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class manual_ota {
4040
/**
4141
* @brief Set common name of the server to verify
4242
*/
43-
const char *common_name_;
43+
const char *common_name_{};
4444
/**
4545
* @brief Wrapper around the http client -- Please set the http config
4646
*/

0 commit comments

Comments
 (0)