Ora

How do I connect my iOS to Charles proxy?

Published in iOS Network Proxying 4 mins read

Connecting your iOS device to Charles Proxy is a straightforward process that allows you to inspect and debug network traffic from your iPhone or iPad directly through your computer.

Prerequisites for Connecting iOS to Charles Proxy

Before you begin, ensure you have the following:

  • Charles Proxy Installed: Charles Proxy should be installed and running on your macOS or Windows computer. You can download it from the official Charles Proxy website.
  • Shared Wi-Fi Network: Both your computer running Charles Proxy and your iOS device must be connected to the same Wi-Fi network.

Step-by-Step Guide to Connect iOS to Charles Proxy

Follow these steps to successfully configure your iOS device to use Charles Proxy:

Step 1: Find Your Computer's IP Address

Your iOS device needs to know where to send its network traffic. This is your computer's local IP address.

  • On macOS:
    1. Go to System Settings (or System Preferences).
    2. Click on Wi-Fi.
    3. Click the Details button (often an "i" icon or "..." next to your connected Wi-Fi network).
    4. Your IP address will be listed next to "IP Address."
  • On Windows:
    1. Open Command Prompt (search for cmd).
    2. Type ipconfig and press Enter.
    3. Look for your active Wi-Fi adapter (e.g., "Wireless LAN adapter Wi-Fi") and find the "IPv4 Address."

Example: Your computer's IP address might be 192.168.1.100.

Step 2: Configure Proxy Settings on Your iOS Device

Now, you'll tell your iOS device to route its network traffic through your computer running Charles.

  1. On your iOS device, open the Settings app.
  2. Tap on Wi-Fi.
  3. Tap the information icon (an "i" in a circle) next to the Wi-Fi network your device is currently connected to (it must be the same network as your computer).
  4. Scroll down to the HTTP Proxy section.
  5. Select Manual.
  6. Enter the following details:
    • Server: Enter the IP address of your computer that you found in Step 1.
    • Port: Enter 8888. This is the default port Charles Proxy listens on.
    • Authentication: Leave this Off unless your network setup specifically requires it.

Here's a quick summary table for your iOS proxy settings:

Setting Value
HTTP Proxy Manual
Server Your Computer's IP Address
Port 8888
Auth Off (typically)

Step 3: Allow the Connection in Charles Proxy

Once you've configured your iOS device, it will attempt to connect to Charles.

  1. On your computer, a Charles Proxy Connection Request dialog box will appear.
  2. Click Allow to permit your iOS device to connect and proxy traffic through Charles.

Step 4: Enable SSL Proxying for HTTPS Traffic (Crucial!)

To inspect encrypted HTTPS traffic (which most modern apps and websites use), you need to enable SSL Proxying in Charles and install a certificate on your iOS device.

  1. In Charles Proxy (on your computer):
    • Go to Proxy > SSL Proxying Settings...
    • Check the box for Enable SSL Proxying.
    • In the "Include" section, click Add.
    • For Host, enter * (to proxy all hosts) or specific hosts like api.example.com.
    • For Port, enter 443 (the standard HTTPS port) or * for all ports.
    • Click OK on both dialogs.

Step 5: Install Charles SSL Certificate on Your iOS Device

Your iOS device needs to trust Charles Proxy as a legitimate intermediary for encrypted connections.

  1. On your iOS device, open Safari (it must be Safari, not another browser).
  2. Navigate to the URL: chls.pro/ssl
  3. Safari will prompt you to download a configuration profile. Tap Allow.
  4. Once downloaded, go to Settings > Profile Downloaded (this option appears immediately after download).
  5. Tap Install in the top right corner, enter your passcode if prompted, and tap Install again.
  6. After installation, you must enable full trust for the certificate. Go to Settings > General > About > Certificate Trust Settings.
  7. Under "ENABLE FULL TRUST FOR ROOT CERTIFICATES," toggle on the switch for Charles Proxy CA. Tap Continue on the warning.

Step 6: Verify the Connection

With all settings applied, you can now check if Charles Proxy is successfully capturing traffic.

  1. Open any app or web browser (Safari, Chrome, etc.) on your iOS device.
  2. Generate some network traffic (e.g., visit a website, refresh an app's feed).
  3. Look at the Charles Proxy interface on your computer. You should see network requests appearing in the "Structure" or "Sequence" view.

Troubleshooting Tips

  • Same Wi-Fi Network: Double-check that both your computer and iOS device are connected to the exact same Wi-Fi network.
  • Firewall: Ensure your computer's firewall is not blocking incoming connections to Charles Proxy on port 8888.
  • VPN: Disable any VPNs running on either your computer or your iOS device, as they can interfere with proxying.
  • SSL Trust: If you see "Unknown" or "SSL Handshake Failed" errors in Charles, revisit Step 5 to ensure the Charles SSL certificate is both installed and fully trusted on your iOS device.
  • Restart Charles: Sometimes, restarting Charles Proxy can resolve connection issues.