charles packet capture https

1. Install Charles root certificate on Mac

Insert image description here

2. Trust the Charles root certificate

Find the Charles Proxy CA certificate in the keychain and set it to "Always Trust". You will be asked to enter the password here. Just fill in the Mac power-on password.
Insert image description here

3. Charles sets "Enable SSL Proxying"

Only https needs to be configured. HTTP requests seem to be able to capture packets without configuring this.
Insert image description here
Select it in the pop-up box “Enable SSL Proxying”, then click Addthe button, and set the Host (domain name) and Port (port) of HTTPS that need to be captured in the pop-up form, if necessary. To capture all HTTPS, fill in the Host “*”and generally fill in the Port “443”.
Insert image description here

Configure the Host to only capture requests for specific domain names. Applicable scenarios: If you connect to a proxy to capture packets, you will not be able to perform Apple-related operations, such as Apple login and Apple Pay. At this time, you can configure the host to only intercept requests for known domain names. (For http requests, packets can be captured regardless of whether the host is configured or not)

Insert image description here
Insert image description here

4. Install the Charles certificate on the mobile device

Insert image description here
Insert image description here

Step 1: Set up a network proxy

Insert image description here

Step 2: Download and install the Charles certificate and enter it in Safarichls.pro/ssl

Insert image description here

Step 3: Set up trust Charles certificate

Settings-General-About This Mac-Certificate Trust Settings
Insert image description here

5. https packet capture failure problem

https packet capture error: You may need to configure your browser or application to trust the Charles Root Certificate. See SSL Proxying in the Help menu.
Insert image description here
Solution: The Charles certificate is not trusted, which leads to the above error.
1. Check whether the Mac trusts the Charles root certificate, step 2 above;
2. Check whether the mobile device trusts the Charles certificate, step 3 of the fourth step above.

Guess you like

Origin blog.csdn.net/haifangnihao/article/details/114888644