Skip to content Skip to sidebar Skip to footer

Ssl Connection Error On Valid Certificate

I got an javax.net.ssl.SSLHandshakeException: Chain validation failed, when I´m trying to connect to my API server, the certificate is valid nowdays, and in the stack trace I got

Solution 1:

In my case it was enought to just set proper system time on device ('Settings' > 'System' > 'Date & Time' > 'Automatic date & time').

Solution 2:

Looking at line Suppressed: java.security.cert.CertPathValidatorException: Could not determine revocation status suggests that the failure occurs at the revocation validation step which relies on the OCSP Protocol.

What might happen here, is that your device is not connected to the internet and can't contact the authority server in order to check the validity of your certificate (it's only a guess).

If you don't want your application to have access to the authority server, you should activate "OCSP stappling" on your server. This means that your server is going to send the OCSP validation receipt as well as the certificate.

Solution 3:

In my case, I had to add this sentence to AndroidManifest.xml:

android:usesCleartextTraffic="true"

as shown in context here:

A screenshot showing this line of code in context in my AndroidManifest.xml file.

Post a Comment for "Ssl Connection Error On Valid Certificate"