Introduction to the

I’ve already introduced Fiddler for Windows, but today I’m going to talk about Charles for MAC. The author will not say more about the use and introduction of Charles. There are many online tutorials. Today, I mainly introduce how to grab HTTP and HTTPS packets on PC and mobile terminals using Charles on MAC.

Don’t row away. There’s a surprise at the end.

The PC captures HTTP packets

Charles is smart. When Charles runs, it creates a proxy service locally. 127.0.0.1:8888, when we start Charles, it will automatically set the proxy for our browser, and we can see the browser request in the Charles panel, but only the HTTP request can be captured at this time, and we need to further configure the HTTPS request.

If Charles does not catch the request, please check if your browser is using proxy software, this is a big hole, be careful.

The PC captures HTTPS packets

First we need to install the root certificate. Find Help -> SSL Proxying -> Install Charles Root Certificate.

The certificate is not trusted by default after it is installed, so we also need to change it to always trust.

Do you think this is enough? No, we have to configure the HTTPS domain name that we need to grab. There are two methods of configuration. The first method is manual configuration. Go to Proxy -> SSL Proxying Settings. Under SSL Proxying, add the domain name you want to grab.

In the Structure column on the home page, select the domain name for which you want to capture HTTPS and right-click Enable SSL Proxying to Enable it. Using this method automatically adds the domain name under SSL Proxying.

This way, using Charles on a MAC, you can capture both HTTP and HTTPS packets.

The mobile end captures HTTP packets

The Charles agent must be enabled for the mobile phone to capture HTTP packets. Go to Proxy -> Proxy Settings. Save Support HTTP/2 and Enable TRANSPARENT HTTP proxying.

Then check the Local Intranet IP Address and go to Help -> Local IP Address.

We need to ensure that the computer and mobile phone are connected to the same Intranet, that is, on the same router, and then manually configure the proxy on the mobile phone. The server is the LAN IP of our computer, and the port is set by us. If there is no change, the default is 8888.

Then our requests to access HTTP links on the mobile end will be captured by Charles normally.

Note that Charles will pop up the confirmation menu of mobile phone request connection when obtaining the request on the mobile terminal for the first time. Click Allow.

The mobile terminal captures HTTPS packets

The mobile terminal captures THE HTTPS package. We also need to download and install the certificate on the mobile terminal. Find Help -> SSL Proxying -> Install Charles Root Certificate on a Mobile Device or Remote Browser. You will see the following prompt.

By default, the root certificate is installed on the MAC and the proxy is configured on the phone.

Enter CHLS. Pro/SSL in the mobile browser, download the certificate, and install it. The iPhone is in System Settings > General > Description file. The author has installed the certificates of Fiddler and Charles. You just need to make sure that you have installed the certificate of Charles.

Note that we also need to configure the HTTPS domain name to be captured under SSL Proxying in Proxy -> SSL Proxying Settings.

Android phone configuration method is similar, I won’t go into the details.

pleasantly surprised

Charles is charged and allows free use for 30 days. I have a registration code here, can be used for small partners.

  • Registered Name: https://zhile.io
  • License Key: 48891cf209c6d32bf4

The code from the network, such as infringement can be deleted.

Afterword.

Well, thank you for your patience. I really hope I can help you. This article is the author’s personal study notes, if there are fallacies, please inform, thank you! If this article has been helpful to you, please click the “like” button. Your support is my motivation to keep updating.