Behrooz Fard
Behrooz Fard

Reputation: 555

HttpsURLConnection error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found

Previously, our website was Http and I used AsyncTask and HttpURLConnection to post data with API but now it is Https and when I convert HttpURLConnection to HttpsURLConnection I got this error:

java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

What should I do?

Upvotes: 1

Views: 2850

Answers (1)

Godfather
Godfather

Reputation: 848

To identify the issue, as I mentioned, firstly try ignoring certificate using TrustManager .if it works then check with the server if it accepts self-signed or which parent certificate. In General, devices already come with preloaded certificates by the majority CA .Here is a detailed link .

Upvotes: 0

Related Questions