Using Fiddler with Apple iOS Devices

Friday, December 21, 2012 by Eric Lawrence | Comments 2

Note: The following content is excerpted from my recently published Fiddler book.

While it’s currently a Windows-only tool, you can still use Fiddler to debug traffic from Apple’s iOS-based devices if you have a Windows-based PC to run Fiddler on, and a Wi-Fi connection shared between that PC and your iOS device. The steps aren’t hard, and this configuration gives you a powerful way to debug iPad, iPod, and iPhone traffic.

Configure Fiddler

To configure Fiddler, click Tools > Fiddler Options > Connections and check the box labeled Allow remote computers to connect. You will need to restart Fiddler for the change to take effect, and you may need to reconfigure your firewall to allow incoming connections to the Fiddler process.

You should verify the client computer can successfully reach Fiddler without problems caused by the firewall or router by opening the browser and visiting http://FiddlerMachineIP:8888. If you see the “Fiddler Echo Service” webpage, then you know that the client and Fiddler are able to communicate.

Hint: You can easily find the Fiddler PC’s IP address by hovering over the Online indicator in the Fiddler toolbar:

image

Note: If you’re using the iPhone, you must disable the 3g/4g connection to force all requests to go over Wi-Fi.

Set the Device’s Proxy

To capture web traffic from an Apple device, you must first configure its proxy settings to point to your Desktop PC running Fiddler.

To access the proxy settings, click the Settings icon on the home screen. In the Settings list, pick General and then choose Network from the list. Click Wi-Fi and push the small blue arrow at the right of the Wi-Fi network’s name to configure its settings. Click the Manual option in the HTTP Proxy section. In the Server box, enter the IP address or hostname of your Fiddler instance. In the Port box, provide the port Fiddler is listening on. You should leave the Authentication slider set to Off.

image

 

Decrypting HTTPS Traffic from iOS

To enable Fiddler to generate certificates compatible with iOS devices, download the Certificate Maker plugin for Fiddler from http://fiddler2.com/r/?FiddlerCertMaker.

This plugin replaces the default certificate generation code in Fiddler with a version based on the open-source Bouncy Castle cryptography library. It generates iOS-compatible certificates by default, and respects several Preferences to enable compatibility with a wide-variety of platforms.

After restarting Fiddler with the new certificate maker installed, first configure the device to trust Fiddler’s root certificate. After configuring your device to use Fiddler as its proxy, open http://ipv4.fiddler:8888/ from your device.

From the bottom of the Fiddler Echo Service webpage, download the FiddlerRoot certificate:image

Open the FiddlerRoot.cer file and you will see the Install Profile screen:

image

Tap the Install button. You’ll then see a warning, which you may acknowledge by pressing the Install button:

image

After Fiddler’s root certificate is installed, your device’s browser and applications should no longer complain about certificate errors when Fiddler is decrypting their traffic.

If you later decide to uninstall the root certificate from the device, open the Settings app, click General, and scroll down to Profiles at the bottom. Select the DO_NOT_TRUST_FiddlerRoot profile, and tap Remove.

Of course, Fiddler can also debug traffic from Windows Phone and Android devices, as well as Linux and Mac systems.

 

-Eric

 

About the author

Eric Lawrence

Eric Lawrence

(@ericlaw) has built websites and web client software since the mid-1990s. After over a decade of working on the web for Microsoft, Eric joined Telerik in October 2012 to enhance the Fiddler Web Debugger on a full-time basis. With his recent move to Austin, Texas, Eric has now lived in the American South, North, West, and East.

Posted in: howto devices

2  comments

  • Matt 23 Dec 2012
    Eric, I followed your instructions for the Iphone, and I do see decryted traffic from mail.google.com for example. But when using Fiddler to decrypt traffic from the app store everytime I open the app store it says that it could not connect to Itunes. And in Fiddler it says that the tunnel to itunes.apple.com was closed. When I disable the option in Fiddler to decrypt traffic then I am able to connect to the app store, but then of course the traffic is encrypted so it is of no use to me.  How am I able to decrypt this type of traffic? Thanks.
  • Eric Lawrence 26 Dec 2012
    Matt: I wrote a little bit about this in the Fiddler Book (http://www.fiddlerbook.com). The short answer is that the AppStore uses a tactic called "Certificate Pinning" to demand that its connections are secured using a *specific* certificate. If it sees any certificate (e.g. Fiddler's) except the one it expects, then it rejects the connection. Some Twitter clients also use Certificate Pinning.

    Unfortunately, there's no way to collect traffic from an application using Certificate Pinning without either the original certificate (e.g. you're Apple) or the ability to modify the application's code (either using the source code, or via an in-memory debugger).

Add comment

  1. Formatting options
       
      
     
     
       
  2. (optional, emails won't be shown on public pages)
  3. (optional)