Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSL handshake exception retrofit android [duplicate]

I am getting unusual exception suddenly after base url got changed from http:// to https://. Every time I hit API with https:// I can see log flashing "HTTP FAILED: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found." this error.

I thought retrofit auto imports the certificate most times (as I have tried connecting https:// many times using retrofit. I didn't faced this issue earlier)

like image 662
The90sArtist Avatar asked Nov 07 '22 15:11

The90sArtist


1 Answers

Your server may use an auto-signed certificate for https.

If this is true, you can avoid the exception by disabling retrofit to check the certificate.

Please, read this:

Disable SSL certificate check in retrofit library

like image 155
Yusef Maali Avatar answered Nov 15 '22 08:11

Yusef Maali