How to Generate a Charles Proxy Log on Your Mac: A Step-by-Step Guide

Troubleshooting network issues or analyzing app behavior often requires inspecting network traffic. This guide provides a straightforward, step-by-step process for generating Charles Proxy logs on your Mac. Whether you're a developer, QA tester, or simply curious about your online activity, learn how to capture and interpret valuable network data using Charles Proxy. Let's get started and unlock the secrets of your network communication!

Step-by-Step Instructions

  1. Download and Install Charles Proxy

    • Go to charlesproxy.com/download and select the correct version for your operating system.
    • Once downloaded, install the program and open it.
    Install and Open Charles: Once downloaded, install the program and open it. Install and Open Charles: Once downloaded, install the program and open it.
    Download and Install Charles Proxy
  2. Configure Charles Proxy Settings

    • Click 'Proxy' in the menu bar and select 'macOS Proxy'.
    • Click 'Help' -> 'SSL Proxying' -> 'Install Charles Root Certificate'. Follow the Keychain Access prompts to always trust the certificate.
    Install Root Certificate: Click 'Help' -> 'SSL Proxying' -> 'Install Charles Root Certificate'. Follow the Keychain Access prompts to always trust the certificate. Install Root Certificate: Click 'Help' -> 'SSL Proxying' -> 'Install Charles Root Certificate'. Follow the Keychain Access prompts to always trust the certificate.
    Configure Charles Proxy Settings
  3. Enable SSL Proxying and Specify Domains

    • Click 'Proxy' -> 'SSL Proxying Settings'.
    • Click 'Add' and specify the domains (or use * for all) you want to decrypt in the 'Host' field. Use port 443.
    Add Domains to Decrypt: Click 'Add' and specify the domains (or use * for all) you want to decrypt in the 'Host' field. Use port 443. Add Domains to Decrypt: Click 'Add' and specify the domains (or use * for all) you want to decrypt in the 'Host' field. Use port 443.
    Enable SSL Proxying and Specify Domains
  4. Start and Verify Recording

    • Click the record button (circle icon) to begin recording your session. A new session can be created by clicking 'File' -> 'New Session'.
    • Visit the specified domains. Decrypted traffic will have a blue circle next to it.
    Verify Decryption: Visit the specified domains. Decrypted traffic will have a blue circle next to it. Verify Decryption: Visit the specified domains. Decrypted traffic will have a blue circle next to it.
    Start and Verify Recording
  5. Save and Close

    • Click the record button to stop, then click 'File' -> 'Save Session As' to save your log as a .charles file.
    • When finished, click 'Help' -> 'SSL Proxying' -> 'Install Charles Root Certificate' -> 'Cancel' and then delete the Charles certificate from Keychain Access.
    Remove Root Certificate: When finished, click 'Help' -> 'SSL Proxying' -> 'Install Charles Root Certificate' -> 'Cancel' and then delete the Charles certificate from Keychain Access. Remove Root Certificate: When finished, click 'Help' -> 'SSL Proxying' -> 'Install Charles Root Certificate' -> 'Cancel' and then delete the Charles certificate from Keychain Access.
    Save and Close
[RelatedPost]

Tips

  • Consult your test cycle overview or chat support to determine which hosts should be added for decryption during a live test cycle.
  • Using an asterisk (*) before and after a website name in the host field will only decrypt traffic from that specific domain.
  • The broom icon clears the log.

Common Mistakes to Avoid

1. Charles Proxy Not Running or Incorrectly Configured

Reason: Charles Proxy might not be running, or the proxy settings in your application or system preferences might not be correctly pointing to Charles.
Solution: Ensure Charles Proxy is running and that your system and application proxy settings are correctly configured to use Charles as your proxy.

2. Incorrect Proxy Settings in the Application

Reason: You might have set the proxy settings in your application incorrectly, for example, using the wrong port or hostname.
Solution: Double-check the proxy settings in your application, ensuring they match the hostname and port specified in Charles Proxy.

3. SSL Proxying Not Enabled

Reason: If you're trying to intercept HTTPS traffic, SSL proxying needs to be enabled in Charles, and you might need to install Charles's SSL certificate.
Solution: Enable SSL proxying in Charles Proxy and install the Charles Root Certificate on your system.

FAQs

Why isn't Charles Proxy capturing my traffic?
Ensure Charles Proxy is properly configured as your system's proxy. Check your system preferences (Network settings) and browser proxy settings to confirm Charles Proxy is selected as the proxy server. Also, verify that the application you're monitoring is routing traffic through Charles Proxy. Some apps might have their own proxy settings you need to configure.
How do I filter the log to see only specific traffic?
Charles Proxy offers powerful filtering options. You can filter by hostname, path, content-type, and more. Use the 'Focus' or 'Filter' functionalities within Charles's interface to narrow down your log to relevant requests and responses. Experiment with different filter criteria to isolate the traffic you need.
What file format does Charles Proxy save logs in?
Charles Proxy primarily saves logs in its own proprietary format (.chls), but you can export specific requests and responses in formats like XML, JSON, or text. The export options are accessible from the context menu when selecting specific entries in your log.