Charles proxy set up for IOS devices

Charles is an HTTP proxy / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP and SSL / HTTPS traffic between their machine and the Internet. This includes requests, responses and the HTTP headers (which contain the cookies and caching information).

Steps for setting up Charles on Mac to intercepting and decrypting network traffics from IOS apps on iPhone.

1. Download Charles and open it. https://www.charlesproxy.com/download/latest-release/

2. Since Charles is running on the Mac, and IOS apps are running on iPhone, they have to be on the same WI-FI network in order for Charles to get the traffics from iPhone. So, make sure your Mac and iPhone is connecting to the same Wi-Fi network.

3. Find the your Mac’s local IP address, it will be needed to configure your iPhone with Charles. You can find your Mac’s local IP address from: System Preferences -> Network, from Network, under the Wi-Fi status, there should have some text such as Wi-Fi is connected to my-home-wifi and has the IP address 192.168.1.123, where 192.168.1.123 will be your Mac’s local IP address.

4. Configure your iPhone to proxy through your Mac’s local IP address. On your iPhone, go to Settings -> Wi-Fi -> Tap on the Wi-Fi network the iPhone and your Mac is connected to -> Tap Configure Proxy -> Select Manual -> Type your Mac’s local IP address under Server -> Type 8888 for the Port number -> tap Save. 8888 is the default port number for Charles.

5. Open a browser app such as Safari on your iPhone and go to any website.

6. Go back to your Mac, click Allow if you see a prompt from Charles saying a connection attempt is made from an ip address which is from your iPhone.

7. Back to your iPhone, open Safari and go to chls.pro/ssl to download the Charles Root certificate, this is required to decrypt the traffic, otherwise the traffics you will be seeing will be just encrypted strings.

8. Install the Charles Root certificate that was downloaded. On your iPhone, go to Settings -> General -> VPN & Device Management -> Select the downloaded Charles Proxy CA and Install it, enter your iPhone password when asked.

9. Make sure the Charles certificate is enabled and trusted. go to Settings -> General -> About -> Certificate Trust Settings -> Tap the ON/OFF toggle to enable and trust the Charles certificate. -> tap Continue to allow when you see a Root Certificate warning saying the certificate for websites will allow third parties to view any private data sent to websites.

10. Back to the Charles on your Mac, enable SSL proxying to view traffic with decrypted data. If you want to see traffics from https://api.example.com/, right click on this network request and click the Enable SSL Proxying option.

11. Everything is now all set up to use Charles to see the network traffic from the apps in your iPhone. As long as your Mac and iPhone are on the same Wi-Fi network and with the above configuration, you should see all the network traffics from your iPhone showing up in Charles.

12. To disconnect, revert the changes you made in WiFi setting on step 4, and go to Settings -> General -> About -> Certificate Trust Settings ->tap the ON/OFF toggle to disable the Charles certificate.

References:
https://www.charlesproxy.com/documentation/using-charles/ssl-certificates/

Search within Codexpedia

Custom Search

Search the entire web

Custom Search