ESP32 Skip Verification of Peer Certificate in HTTPS OTA Example

AnthonyThet
Posts: 11
Joined: Sun Sep 06, 2020 6:46 am

ESP32 Skip Verification of Peer Certificate in HTTPS OTA Example

Postby AnthonyThet » Tue Dec 27, 2022 5:42 am

Hi, in my current project, I need to add https ota feature for the ESP32 but for my understanding-sake, I am now using "advanced_https_ota_example" to download a bin file from the https server (where there is no certificate involved for the test purpose). To skip the CA certification step, I followed exactly to the steps in this topic

Code: Select all

To completely disable the certificate check, you will need to go to ESP-TLS in menuconfig, enable "Allow potentially insecure options" and then enable "Skip server certificate verification by default" (accepting risks)
but when I run my example, I recevied the following errors.

I (5624) advanced_https_ota_example: Starting Advanced OTA example
W (5634) wifi:<ba-add>idx:0 (ifx:0, 64:a7:dd:20:19:80), tid:0, ssn:0, winSize:64
W (5654) wifi:<ba-add>idx:1 (ifx:0, 64:a7:dd:20:19:80), tid:7, ssn:0, winSize:64
E (5894) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x2700
I (5894) esp-tls-mbedtls: Failed to verify peer certificate!
I (5894) esp-tls-mbedtls: verification info: ! The certificate is not correctly signed by the trusted CA
! The certificate is signed with an

E (5914) esp-tls: Failed to open new connection
E (5914) TRANS_SSL: Failed to open a new connection
E (5924) HTTP_CLIENT: Connection failed, sock < 0
E (5924) esp_https_ota: Failed to open HTTP connection: ESP_ERR_HTTP_CONNECT
E (5934) esp_https_ota: Failed to establish HTTP connection
E (5944) advanced_https_ota_example: ESP HTTPS OTA Begin failed


How do I solve this issue?
I am using:

ESP-IDF-Version : esp-idf-v4.3.1
IDE: VSCode
HW: ESP32-WROOM-32E

Please let me know if you need any additional information and thanks so much in advance...

Who is online

Users browsing this forum: No registered users and 234 guests