Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

Charles is the most commonly used packet capture tool on the MAC. It actually acts as an HTTP proxy server. When the browser connects to Charles’s proxy to access the Internet, Charles can monitor all the data sent and received by the browser, and is often used to test interfaces and investigate other interfaces.

One: wifi Settings

Install Charles on the computer side, ensure that the phone and computer are in the same network environment, namely WiFi, and then enter the setting page as shown in the picture.

On the page that is displayed, the configuration method is displayed. IP proxy is required on mobile phones.

Xiaomi mobile phone open “Settings ->WLAN”, as shown in the picture, click the small arrow on the right of the WiFi being connected. Open “Network Details”, click “Agent” below, and select “Manual”. Then fill in the IP in step 2 with the host name and the port with the port. Click “OK” to exit the setting.

Two: Mobile client certificate installation

  1. Open non-own browser, quark /QQ mobile phone browser can (UC does not consider, the more do the more bad), input the url CHLS. Pro/SSL, will prompt to download the certificate, at this time to download a. Pem format. You need to manually change it to the. CRT format and finally put it into the DownLoad folder of Xiaomi.

  1. Enter the phone Settings again, choose More Settings > System Security > Install from storage Device >Download >.crt file > OK, name the certificate Charles in the pop-up window, and click OK (the first time you install the certificate, you will enter the screen-lock password). The certificate has been successfully installed! At the computer end of the mobile phone network immediately capture it!

3: PC SSL proxy Settings

SSL Proxying not enabled for this host:enable in Proxy Setting,SSL locations. Interface files always say: unknown. The solution is as follows:

Proxy -> SSL proxy setting

If you want to see all captured packets, you can set this parameter: