5

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)

The90sArtist
  • 177
  • 1
  • 1
  • 9

2 Answers2

1

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

Yusef Maali
  • 2,201
  • 2
  • 23
  • 29
0

The problem is not on app side absolutely. Tell your supervisor that your HTTP clients can’t connect to fatally insecure HTTPS servers. You can say it's a limitation of computers and your only option is to update the server.

Once you’ve done that you can add a development-only debug mode. To do it, enable a cipher suite that your server supports. You can get the list from the Qualys tool.

Sunil P
  • 3,698
  • 3
  • 13
  • 20