Page MenuHomePhabricator

Trust user added Certificates Authorities(CAs) on Android 7 and beyond
Closed, DeclinedPublic

Description

Starting in from Android Nougat, an application won't trust user added CAs by default (see android developers blog).
If a user uses an ISP's content filtering service or conent filtering service based on vpn (I for example use Netspark),
the content filtering service needs to be decrypted and reencrypted by the content filtering serive. for doing that the ISP/vpn server replaces the ssl certificate by an ssl certificate signed by himself. to make android trust the new certificate he asks the user to add it as a trusted CA by installing a .crt file.
But because starting from nougat an application won't trust user added CAs, wikipedia won't trust the new certificate, a "java.security.cert.CertPathValidatorException: Trust anchor for certification path not found" will be thrown and the user will see something like "Could not connect to internet".

The solution is to set network-security-config in AndroidManifest.xml to trust both user and system CAs as noted in the foregoing link to android developers blog.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Acctually I have already implemented that solution and it works great! I'll be happy to contribute it to the github repo, but as I read I should wait until it will get out of open tasks/needs triage category, am I right?

nyemini renamed this task from Trust user added Certificates Authorities(CAs) to Trust user added Certificates Authorities(CAs) on Android 7 and beyond.Mar 27 2019, 10:20 AM

@nyemini Feel free to submit a pull request on github anytime. We'll prioritize the ticket as necessary.

I'm afraid this is unlikely to be done.

Amm, actually, the PR mentioned above has been merged. So declined status isn't appropriate:)
I'm sorry I forgot to notify here.

It was merged by accident and then reverted.