simple_ota_example: Firmware Upgrades Failed

axellin
Posts: 197
Joined: Mon Sep 17, 2018 9:09 am

simple_ota_example: Firmware Upgrades Failed

Postby axellin » Fri Nov 16, 2018 8:54 am

Hi,
I'm using current master tree.
I follow exactly the steps mentioned in examples/system/ota/README.md
I'm sure the Common Name is exactly the same as my hostname.
But I still got below error:

I (5284) event: sta ip: 192.168.0.100, mask: 255.255.255.0, gw: 192.168.0.1
I (5284) simple_ota_example: Connect to Wifi ! Start to Connect to Server....
E (5364) esp-tls: mbedtls_ssl_handshake returned -0x2700
I (5364) esp-tls: Failed to verify peer certificate!
I (5364) esp-tls: verification info: ! The certificate Common Name (CN) does not match with the expected CN

E (5374) esp-tls: Failed to open new connection
E (5374) TRANS_SSL: Failed to open a new connection
E (5384) HTTP_CLIENT: Connection failed, sock < 0
E (5384) esp_https_ota: Failed to open HTTP connection: ESP_ERR_HTTP_CONNECT
E (5394) simple_ota_example: Firmware Upgrades Failed


Below is the output from server side:
$ openssl s_server -WWW -key ca_key.pem -cert ca_cert.pem -port 8070
Enter pass phrase for ca_key.pem:
Using default temp DH parameters
ACCEPT
140269367329216:error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate:../ssl/record/rec_layer_s3.c:1399:SSL alert number 42

Any idea to debug this issue?

axellin
Posts: 197
Joined: Mon Sep 17, 2018 9:09 am

Re: simple_ota_example: Firmware Upgrades Failed

Postby axellin » Tue Nov 20, 2018 1:57 am

Resolved the issue by using ip address instead of hostname as CN. (I tested with connecting a local server with ip address)

Who is online

Users browsing this forum: Google [Bot] and 121 guests