简体   繁体   中英

Android does not accept root CA certificate

I have an android app that talk to my internal server with https. The server uses a certificate from my companies' root CA. I have installed the root certificate in my store. When I access the API on my Windows machine the certificate is shown as valid.

I don't want to disable the certificate validation and I don't want to abstain from using SSL.

The error I receive is: Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

You have to specify network security config by a reference from your application's block in the manifest. Check it out .

If I remember well, starting from Android N it became necessary to specify trusted certificates groups explicitly in manifest.

Windows just trusts all certificates that through a chain of trust point to any root trusted certificate. Android has it's own opinion about that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM