forked from espressif/esp-protocols
fix(modem): Fixed OTA test to gracefully fail with no verification
This commit is contained in:
@ -35,6 +35,10 @@ bool manual_ota::begin()
|
|||||||
esp_transport_handle_t tcp = esp_transport_tcp_init();
|
esp_transport_handle_t tcp = esp_transport_tcp_init();
|
||||||
ssl_ = esp_transport_batch_tls_init(tcp, max_buffer_size_);
|
ssl_ = esp_transport_batch_tls_init(tcp, max_buffer_size_);
|
||||||
http_.config_.transport = ssl_;
|
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)) {
|
if (!esp_transport_batch_set_ca_cert(ssl_, http_.config_.cert_pem, 0)) {
|
||||||
return fail();
|
return fail();
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Set common name of the server to verify
|
* @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
|
* @brief Wrapper around the http client -- Please set the http config
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user