Search code examples
androidsslssl-certificatewebproxycharles-proxy

How to configure SSL certificates with Charles Web Proxy and the latest Android Emulator on Windows?


I would like to use Charles web proxy to work with the Android emulator in Windows. I've successfully set up charles and have started the emulator with the command line:

emulator -http-proxy 127.0.0.1:8888 @NexusOne

I can see traffic coming from the android emulator in Charles, but the problem is that I'm developing against a live API which uses SSL and I'm not sure how to configure Charles to let me play about the the data which is sent and received. I'm aware of two areas where SSL is set up in Charles (Proxy -> Proxy Settings -> SSL and Proxy -> Client SSL Certificates) but I can't find any decent documentation which has let me do what I want to do. Has anyone experience with Charles, or certificates in general, who can explain how to achieve this. Maybe a primer on certificates would be good too, as I seem to be lacking knowledge as to why this is so difficult.


Solution

  • In Charles, go to Proxy>>Proxy Settings and select the SSL tab. Add your host to the list of Locations.

    For example, if your secure call is going to https://secure.example.com, you can enter secure.example.com, or *.example.com.

    Once the above is in place, you may need to right-click on the call in the main Charles window and select the SSL Proxying option.

    Hope this helps.