How to configure SSL certificates with Charles Web Proxy and the latest Android Emulator on Windows?
Solution 1:
To remotely capture http or https traffic with charles you will need to do the following:
HOST - Machine running Charles and hosting the proxy CLIENT – User’s machine generating the traffic you will capture
Host Machine
- Install fully licensed charles version
- Proxy -> Proxy Settings -> check “Enable Transparent HTTP Proxying”
- Proxy -> SSL Proxying Settings -> check “enable SSL Proxying”
- Proxy -> SSL Proxying Settings -> click Add button and input * in both fields
- Proxy -> Access Control Settings -> Add your local subnet (ex: 192.168.2.0/24) to authorize all machines on your local network to use the proxy from another machine
- It might be advisable to set up the “auto save tool” in charles, this will auto save and rotate the charles logs.
Client Machine:
- Install and permanently accept/trust the charles SSL certificate
http://www.charlesproxy.com/documentation/using-charles/ssl-certificates/ - Configure IE, Firefox, and Chrome to use the socket charles is hosting the proxy on (ex: 192.168.1.100:8888)
When I tested this out I picked up two lines of a Facebook HTTPS chat (one was a line TO someone, and the other FROM)
you can also capture android emulator traffic this way if you start the emulator with:
emulator -avd <avd name> -http-proxy http://local_ip:8888/
Where LOCAL_IP is the IP address of your computer, not 127.0.0.1 as that is the IP address of the emulated phone.
Source: http://brakertech.com/capture-https-traffic-remotely-with-charles/
Solution 2:
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.
Solution 3:
For what it's worth here are the step by step instructions for doing this in an Android device. Should be the same for iOS:
- Open Charles
- Go to Proxy > Proxy Settings > SSL
- Check “Enable SSL Proxying”
- Select “Add location” and enter the host name and port (if needed)
- Click ok and make sure the option is checked
- Download the Charles cert from here: Charles cert >
- Send that file to yourself in an email.
- Open the email on your device and select the cert
- In “Name the certificate” enter whatever you want
- Click OK and you should get a message that the certificate was installed
You should then be able to see the SSL files in Charles. If you want to intercept and change the values you can use the "Map Local" tool which is really awesome:
- In Charles go to Tools > Map Local
- Select "Add entry"
- Enter the values for the file you want to replace
- In “Local path” select the file you want the app to load instead
- Click OK
- Make sure the entry is selected and click OK
- Run your app
- You should see in “Notes” that your file loads instead of the live one