-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32 after a few days starts returning error Certificate is expired or not yet valid #27
Comments
The timestamp is fixed at the last compile time, and that's probably what is causing the issue. SSLClient uses the compilation timestamp as the "current time" in leu of a real time clock, which is why re-uploading fixed the error but restarting didn't: SSLClient/src/TLS12_only_profile.c Lines 410 to 426 in 32d1c55
Given this, I would say that your issue is expected behavior, at least for the moment. Are you looking for a function to change the fixed timestamp? I did notice that the documentation doesn't mention this behavior anywhere, so I can go ahead and fix that. |
So if I write a function that pulls in an epoch time stamp and sets the ESP32 current time to that value and then passes that timestamp to the validation function that should solve this issue? |
I think so. I went ahead and added a |
Hi - I've got self-signed certificates with an extremely long expiration date set. Will I be running into this issue after devices have been in the field a few months as well? |
No, this issue will only occur if a certificate expires or is replaced while the device is operating. Since you control the certificate chain, so long as you never replace the certificates without re-flashing the devices you should be fine. |
Thanks. |
Once again thanks for monumental job. I have tried too many alternative libraries, but only given library's performance got just fine. |
Sorry for the silly questions but I'm newbie and I'm having the same problem of @goseese. Should I call void setVerificationTime (uint32_t days, uint32_t seconds); function before (!client.connect(host, httpsPort)) ? |
Hi, |
So I added the following to when I connection to the WIFI module is established. Now I get the following messages: When does "setVerficationTime" need to be called? I am effectively using the conversion for day to 1/1/0 from the BEARSSL calc. When I use compile time there is no issue but when I set the time in the code with the same calc it says the Cerficate is expired. What am I doing wrong? Thanks Bruce |
|
I have exactly the same problem you have. Did you find a solution? I find epoch from UTP server and convert it via the following command:
If someone has a solution, please share it :)
|
Despite possessing a valid certificate, I'm encountering an ongoing issue. Previously, everything operated smoothly, but after a span of 67 days, all my devices unexpectedly disconnected. I rely on an AWS IoT Core auto-signed certificate, depicted below, yet the outcome remains the same as shown in the logs bellow. After re-flashing the devices, without any code changes, back to work again. CertificateLogs |
I had the same problem as in the previous comment (#27 (comment)), also on AWS IoT Core, with authenticated certificates. In my case, rewriting does not solve the problem either. |
I also suffered frome the same problem. But I've solved this problem, and I'll talk about how I've solved it. But, This method is not a fundamental problem-solving method. As mentioned in "StefanoPierini commented on May 16, 2023", it was resolved using setVerificationTime. The location of the function I used was executed before "mqtt server connect". To reveal a bit of the sauce My development environment uses "VSCode PlatformIO IDE". I am using the libraries of "SSLClient" and "subclient". I hope this comment from me will be helpful. |
I have a sketch that runs on many ESP32 devices with a W5500.
All devices have been running fine for approx 1 month with no issues.
Recently all the devices have started reporting the following error when attempting to connect to my server.
The server ssl certificate is a letsencrypt certificate and is working properly. Double checking the certificate expire data is about 90 days from the current date. The certificates have recently renewed.
First I forced the certificate to renew again, and rebooted the devices, no change.
Then I re-uploaded firmware to one of the devices. No changes were made to the firmware. The trust anchor was not changed. - The device started working.
I then forced the certificate to renew again. This did not cause the problem to come back for that device and all other devices were un-changed.
As a check I exported the trust anchor again and compared to the existing trust anchor. The trust anchor content did not change.
So my problem is I have many devices that are failing with the stated error "Certificate is expired or not yet valid". The only fix seems to be re-uploading unchanged firmware to the device.
Perhaps there is something with timestamp that validates the certificate at compile time and I need some way to update that time stamp?
The devices do not have an RTC and I do not set the time on them. I Can make a code change to do that, however uploading new code temporarily solves the issue so it would be hard for me to verify that is a fix.
The text was updated successfully, but these errors were encountered: