SSL Proxy/Charles and Android trouble
for the Android7
refer to: How to get charles proxy work with Android 7 nougat?
for the Android version below Android7
From your computer, run Charles:
Open Proxy Settings: Proxy -> Proxy Settings, Proxies Tab, check "Enable transparent HTTP proxying", and remember "Port" in heart.
SSL Proxy Settings:Proxy -> SSL Proxy Settings, SSL Proxying tab, Check “enable SSL Proxying”, and add . to Locations:
Open Access Control Settings: Proxy -> Access Control Settings. Add your local subnet to authorize machines on you local network to use the proxy from another machine/mobile.
In Android Phone:
Configure your mobile: Go to Settings -> Wireless & networks -> WiFi -> Connect or modify your network, fill in the computer IP address and Port(8888):
Get Charles SSL Certificate. Visit this url from your mobile browser: http://charlesproxy.com/getssl
In “Name the certificate” enter whatever you want
Accept the security warning and install the certificate. If you install it successful, then you probably see sth like that: In your phone, Settings -> Security -> Trusted credentials:
Done.
then you can have some test on your mobile, the encrypted https request will be shown in Charles:
Edit - this answer was for an earlier version of Charles. See @semicircle21 answer below for the proper steps for v3.10.x -- much easier than this approach too... :-)
For what it's worth here are the step by step instructions for this. They should apply equally well in iOS too:
- 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
Thanks for @bkurzius's answer and this update is for Charles 3.10+. (The reason is here)
- Open Charles
- Go to Proxy > SSL Proxy Settings...
- 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
- Go to Help > SSL Proxying >
Install Charles Root Certificate on a Mobile Device or Remote Browser...
, and just follow the instruction. (use the Android's browser to download and install the certificate.) - In “Name the certificate” enter whatever you want
- Click OK and you should get a message that the certificate was installed