I’m doing production support for an iOS mobile app. The pain point is hard to debug HTTPS traffic between the iPhone and our server. In this article, I will explain how to capture the requests, response and the HTTP headers.

Step 1:

Download and install Charles: https://www.charlesproxy.com/download/ in your laptop. Click install “Charles Root Certificate on a Mobile Device or Remote Browser”.

Then you would see a popup with details above.

Step 2:

Use your iPhone connect to the same wifi network. In the iPhone wifi setting, you can choose HTTP proxy, click on Configure Proxy with Manual details:

Fill in the Server and Port number from the same info of the popup. You would then see the popup updated for the connection:

Next, open the Safari in your iPhone and browse to chls.pro/ssl to download and install the certificate by clicking allow:

Click “Install” of the Profile:

And you are done:

Step 3:

In your iPhone device, go to Setting > General > About > Certificate Trust Settings and toggle the Charles Proxy CA to on.

Finally step:

Restart Charles, you can then see the traffic with https content! For example, the medium app on iOS traffic is captured as shown below:

Let me know if you encounter any problem. Happy Debugging :)