Skip to content

Commit

Permalink
fix(modem): Fixed OTA test to gracefully fail with no verification
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cermak committed Jan 17, 2024
1 parent ce7dadd commit 1dc4299
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class manual_ota {
/**
* @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
*/
Expand Down

0 comments on commit 1dc4299

Please sign in to comment.