Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.security.cert.CertificateNotYetValidException even after the "valid from" Date

When I try to connect to a URL I am getting the below log trace

2017-03-18 00:11:54.519 ERROR: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateNotYetValidException: NotBefore: Tue Mar 14 13:53:28 PDT 2017

The Server's certificate is valid from Mar 14 2017 and I am trying to connect on Mar 18 2017 still why this error occurs? Is there any other cause for this exception?

Most of the answers for similar question suggest to check the systems time but in this case the logger is added with system time, so it is not the case.

like image 322
sanjeev Avatar asked Nov 15 '25 01:11

sanjeev


1 Answers

In my case, the emulator date wasn't correct, it was set to 8 days earlier then the actual date.

Edit: As a tip, i would recommend to use Cold Boot for the emulator. Because the date and time only get updated on Cold boot, but not on Quick boot.

like image 76
S0und Avatar answered Nov 17 '25 15:11

S0und



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!