[MAC, IOS] charles packet capture configuration tutorial, pro test is effective

Environment: mac ios

1. Computer settings

After downloading charles on the computer, you should be able to capture HTTP packets by default, but if you want to capture HTTPS, you need to make additional settings.

The first step is to install the certificate on the mac side as shown in the figure below, which will allow you to add keychain access, filter the certificate to query the certificate of Charles, and change the encrypted socket protocol layer to always trust.

The second step is to set the ssl proxy on the computer side, click SSL Proxying Settings, click add, I have set all the HOSTs in it, so I use *, fill in 443 for the port number, and click ok to finish. At this time, it should be possible to catch the Https request on the computer side normally.

Note: If you want to catch the computer, you need to tick macos proxy

2. Mobile terminal settings

If you want to grab requests from the ios side, you need to make the following settings:

The first step is to confirm the ip address, open charles-》help->local IP Address and select the ip address of en0.

The second step, open the proxy settings to find the port number, the default is 8888.

The third step is to configure the iOS proxy to the computer ip address

ios open Settings-"Wireless LAN->Click Current Details-"Select Configure Proxy->Fill in the ip address server and port number queried in the above steps. When you're done, you should be able to catch the HTTP request on charles on the computer.

The fourth step, if you want to capture the HTTPS request on the ios side, you need to make an additional setting. Open the mobile browser and enter chls.pro/ssl, and the mobile phone will pop up to download the certificate. After the download is complete, click Settings-"General->About This Machine-" Pull down to the bottom and click Certificate Trust Settings to tick the certificate you just downloaded, and it's ok.

3. charles use

The captured package is almost as shown in the figure below, and various requests can be captured. It is very important for testing, development and other positions to test the usability of interfaces. For more detailed usage, you can find tutorials on the Internet. I believe that after reading this article, you have learned how to use charls to capture packets. If you feel that the article is helpful to you, you can leave yours where it should be. Oh footprints! ! !

Finally:  The complete software testing video learning tutorial below has been sorted out and uploaded, and friends can get it for free if they need it【保证100%免费】

insert image description here

 These materials should be the most comprehensive and complete preparation warehouse for [software testing] friends. This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey, and I hope it can help you too!

Guess you like

Origin blog.csdn.net/wx17343624830/article/details/129757518