charles packet capture https
1. Install Charles root certificate on Mac
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.
3. Charles sets "Enable SSL Proxying"
Only https needs to be configured. HTTP requests seem to be able to capture packets without configuring this.
Select it in the pop-up box “Enable SSL Proxying”
, then click Add
the 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”
.
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)
4. Install the Charles certificate on the mobile device
Step 1: Set up a network proxy
Step 2: Download and install the Charles certificate and enter it in Safarichls.pro/ssl
Step 3: Set up trust Charles certificate
Settings-General-About This Mac-Certificate Trust Settings
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.
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.