Setting up Charles Proxy and make it work behind VPN

Charles Proxy is one of the most used tool in mobile developers kit.

Here is a brief on the the steps required to make it work in an enterprise VPN setup.

I am using Charles proxy version 4.1.2 on mac.

  1. Download it from here and install it. Grant necessary permission.Screen Shot 2017-05-23 at 11.57.54 AM.png
  2. Make sure in your network settings, auto proxy is not turned on.Screen Shot 2017-05-23 at 11.17.16 AM.png
  3. One point to keep in mind is that, any network settings related changes should be done before running Charles. Also make sure to run the iOS simulator only after running the Charles.
  4. Run Charles and install the root certs for iOS simulators.Screen Shot 2017-05-23 at 11.31.41 AM.png
  5. Upon success, you should be seeing this:Screen Shot 2017-05-23 at 11.43.01 AM
  6. Now, you can see all the traffic originating from your mac machine. There are two ways to segregate the data in the UI. They are Structure and Sequence. In the sequence mode, you can apply filter and see only traffic data you are interested in.
  7. Structure Views.png
  8. Sequence View with filter appliedse.png
  9. On a side note, it is a good idea to keep the request and response separate in UI.Screen Shot 2017-05-23 at 11.58.17 AM.png
  10. Run your Xcode project and identify the traffic to the domain you are interested in. At first, you would see the encrypted content like below. I just opened in iOS simulator’s Safari app.Screen Shot 2017-05-23 at 12.05.20 PM.png
  11. In the above example, we are interested in In order to see the content in plain text we need to enable ‘SSL Proxying’ for this domain. There are multiple ways to do this. The easiest is to right click the domain in the Structure View and select the option ‘SSL Proxying’ from menuUntitled.png
  12. You should see a blue globe like icon next to all domains, whose content is decrypted or readable by Charles.

 Screen Shot 2017-05-23 at 11.50.19 AM.png

13. Once, done you can see all the traffic in plain textScreen Shot 2017-05-23 at 12.24.17 PM.png

You can also set breakpoints against a specific domain and edit the requests/responses based on your needs.There is no extra steps to be done if you are developing behind a VPN, based on my experience.

Setting up Charles Proxy and make it work behind VPN

Installing certs in iOS Simulators

In older version of Xcode, installing SSL certs were done by simply dragging and dropping SSL certs in to the simulator and by following the prompts till the installation is complete.

In addition to dragging and dropping SSL certs to simulator, you need to do one more step.

General -> About -> Certificate Trust Settings -> “Enable Full Trust for Root Certificate” for your particular certificate

Screen Shot 2017-05-23 at 10.58.21 AM

Screen Shot 2017-05-23 at 10.58.33 AMScreen Shot 2017-05-23 at 10.58.39 AMScreen Shot 2017-05-23 at 10.58.46 AMScreen Shot 2017-05-23 at 10.59.01 AM

Screen Shot 2017-05-23 at 11.21.53 AM

Installing certs in iOS Simulators