1. Install Charles.

2. If macOS Proxy is selected, the packet is captured on the mobile device.

3. Prepare A mobile phone with A mobile phone card A, set — “personal hotspot, open hotspot;

4. In addition, prepare A mobile phone B for bag capture. Both mobile phone B and PC are connected to the hot spot of mobile phone A;

5. View the IP address of the PC.

6. Mobile phone B, click the connected hotspot, set the HTTP proxy to manual, set the proxy parameters, and the server IP is consistent with the PC;



7. Set Charles Proxy on PC, and the port number should be the same as that in Proxy.

8, the above Settings are completed, you can catch the iOS mobile terminal package;

9. Capture HTTPS packets

After configuring the iPhone proxy, you can preview the HTTP request data in the Structure or Sequence window. However, because the HTTPS request is encrypted, only garbled data can be previewed. To preview the data plaintext of HTTPS requests, you need to install certificate authorization on your PC and iPhone.

1) PC installation certificate

You can Install the Certificate for PC on the Charles menu bar -> Help -> SSL Proxying -> Install Charles Root Certificate, which can be viewed in the Mac keystring.

The certificate can be viewed in the Mac keystring. Double-click the certificate to set the trust permission to always trust. The illustration is as follows:

2) on the iPhone browser visit http://charlesproxy.com/getssl certificate can be downloaded and installed. This address generally does not change, Charles menu bar -> Help -> SSL Proxying -> Install Charles Root Certificate on a Mobile Device or Remote View the latest official certificate download address in Browser.

After installing the iOS certificate trust mechanism and trusting the certificate, you need to enable the root certificate in iPhone Settings > About Local Computer > Certificate Trust Settings. The illustration is as follows:


This way, you can use Charles to capture the HTTPS request from the iPhone and preview the plaintext data.

10. Enable the SSL permission for packet capture

From the Charles menu bar -> Proxy -> SSL Proxying Settings, select Enable SSL Proxying. Then add hosts and ports to Locations to capture packets. The illustration is as follows:

Alternatively, on the packet capture page, right-click a request or group, and click Enable SSL Proxying in the displayed options list to Enable SSL Proxying. The illustration is as follows:

Source: this article is reproduced by the third party, if there is infringement, please contact xiaobian to delete.