Time source when validating certificate in TLS/SSL connection

matt87
Posts: 1
Joined: Tue Jun 27, 2017 2:53 am

Time source when validating certificate in TLS/SSL connection

Postby matt87 » Tue Jun 27, 2017 3:11 am

Dear all

I'm facing some issues while trying to make a mutual TLS/SSL authentication with my ESP8266.
I'm using the last NON OS SDK (2.1.0), and i'm having some problem regarding the time source that ESP8266 use to validate the after/before of the certificate sent by the server (I'm trying the connection with a server, acting as a client).

Here follows the log of the failure:

Code: Select all

TCP: connecting...
TLS.ca_x509.cer 1df
TLS.x509_1024.cer 1d7
certificate 1d7
private_key 261
client handshake start.
distinguished names: [COMODO SHA-256 Domain Validation Secure Server CA]
please start sntp first !
before 1458000000, tv_sec 16, after 1539388800
client handshake failed
Error: Cert is not yet valid


From what i can understand, it shows exactly the before and after of the certificate sent by the server, showing the ESP8266 current time as well, identificated as "tv_sec", at least it seems.
The error is quite clear, and the validation fail cause the certificate is considered not yet valid, since the time setup on ESP8266 appear to be much before (tv sec = 16).
After some investigation, I was not able to understand where this time, that I could consider system time, can be set.
The system time, as mentioned in the NON OS SDK file, can be only read and not written, and even the RTC, doesn't seems related to this timestamp.
Does anybody knows how to setup this time counter, that ESP8266 is using for validating certificate?

Thank you in advance.

Matteo

donghengqaz
Posts: 5
Joined: Tue Jun 13, 2017 11:40 am

Re: Time source when validating certificate in TLS/SSL connection

Postby donghengqaz » Wed Jun 28, 2017 3:28 pm

If you use certification with time checking, you should start SNTP client firstly and then get the real time, or close the function checking certification time.

Who is online

Users browsing this forum: No registered users and 64 guests