Charles SSL Proxy works for Chrome, but not for applications

I am using a Nexus 5X device running Android 7. I was unable to install the proxy server using the latest instructions from the Charles Proxy documentation. I installed the certificate, but the wifi or nugat settings are advanced. I can set charles as a certificate, but this will not allow me to connect to this Wi-Fi (authentication problem). Therefore, I leave it as "do not check the correctness." I don’t even know if this is true.

The fact is that I'm trying to sniff my https calls for the applications that I see. SSLHandshake: Received fatal alert: certificate_unknown However, if I run the web client using chrome on the same device, I can read the calls with the same api.

On the bottom line, this works for the browser, but not for my application. I also checked other applications. The same way out.

The reason I'm asking for is because maybe I need to add an insecure client to my api setup to configure api, hopefully not.

+4
source share
2 answers

Here's how you need to configure apk to get CharlesProxy to work in Android 7.

Android

Starting with Android N, you need to add configuration to your application in order to trust the SSL certificates created by Charles SSL Proxying. This means that you can only use SSL proxying with applications that you control.

Charles, . , CA (, Charles Root Certificate). , , .

res/xml/network_security_config.xml :

<network-security-config> 
  <debug-overrides> 
    <trust-anchors> 
      <!-- Trust user added CAs while debuggable only -->
      <certificates src="user" /> 
    </trust-anchors> 
  </debug-overrides> 
</network-security-config>

, :

<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
    <applicationandroid:networkSecurityConfig="@xml/network_security_config" ... >
        ...
    </application>
</manifest>

:

https://www.charlesproxy.com/documentation/using-charles/ssl-certificates/

+1

Charles → SSL Proxying → Charles Root Certificates IOS, iOS Simulator . .

0

Source: https://habr.com/ru/post/1656772/


All Articles