How to get charles proxy work with Android 7 nougat?
<p>Android 7 introduced some changes to the way certificates are handled (<a href="http://android-developers.blogspot.com/2016/07/changes-to-trusted-certificate.html">http://android-developers.blogspot.com/2016/07/changes-to-trusted-certificate.html</a>) and somehow I cannot make my Charles proxy work any more.</p>

<p>My network_security_config.xml:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;network-security-config&gt;
    &lt;base-config&gt;
        &lt;trust-anchors&gt;
            &lt;certificates src="system" /&gt;
        &lt;/trust-anchors&gt;
    &lt;/base-config&gt;
    &lt;debug-overrides&gt;
        &lt;trust-anchors&gt;
            &lt;certificates src="user" /&gt;
        &lt;/trust-anchors&gt;
    &lt;/debug-overrides&gt;
&lt;/network-security-config&gt;
</code></pre>

<p>I'm running in debug mode. But no matter what, I get <code>javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.</code>.</p>

<p>Needless to say, I did install a <code>pfx</code> certificate from <code>Settings -&gt; Security -&gt; Install from storage</code>. The certificate shows in <code>User Credentials</code> but not in <code>Trusted credentials -&gt; User</code>. On my lollipop device, the certificates are listed there. </p>

<p>I'm using okhttp3 as HTTP library.</p>

<p>Any idea what I am doing wrong ?</p>