Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Charles proxy SSL connections won't show hostnames, only ips

I'm using Charles to debug my apps- on both android and ios. something rather strange happens, on the secured connection, after I have installed Charles CA on the devices.

On IOS, Charles will show the request to the hostname in the list of connections, and it looks great.

However, on android, it will only show the IP. I have to open the request and check for the hostname header to figure out the hostname- and that's pretty annoying.

Any way around this?

like image 442
azv Avatar asked Nov 15 '15 20:11

azv


People also ask

How do I find my Charles IP address?

Check what's your current local IP address (Charles → Help → Local IP Address). On your mobile, navigate to Settings → Wi-Fi → Choose the common Wi-Fi connection for both phone and System → Modify Network → Show Advance Settings → Proxy=Manual → Proxy Hostname=Local IP address → Port=8888 and save.

How do I read a Charles Proxy log?

Check the proxy configuration. Open Charles Proxy, if it is not already open. Open your mobile device's browser and navigate to a site. Grant access when prompted that a device is trying to connect to your network. You should now see your mobile device's traffic in your Charles Sequence log.

How do I install a Charles SSL certificate on my Iphone?

iOS devices If you are on iOS 10.3 or later, open the Settings. app and navigate to General > About > Certificate Trust Settings, and find the Charles Proxy certificate, and switch it on to enable full trust for it (More information about this change in iOS 10).


2 Answers

Emulators for API 25+ have a simulated wifi access point called AndroidWifi: https://developer.android.com/studio/run/emulator#wi-fi

Go to your emulators wifi settings, connect to the AndroidWifi, then hold down on it and select modify network. Enter your Charles Proxy hostname and port. It should connect to the proxy and you should see domain names in the requests.

Don't use the proxy settings provided in the emulator's extended controls.

like image 107
Simon Avatar answered Sep 29 '22 19:09

Simon


This happens because Android emulator is a VM and not just a mac os process like the iOS simulator. To be able to see hostnames using Android emulator (Tested on Android 8.0) you have to go to Setting -> Network & Internet -> Mobile network -> Access point names -> Click on the access point and set Proxy and Port properties to your charles local address (You can find it on Charles -> Help -> Local IP Address)

UPDATE:

Google has changed this on the last version of Android emulator. Now you have to add a new APN. Just create a new APN with any name and the APN set to "http://", proxy to 10.0.2.2 and port to 8888

like image 21
Giovanni Marques Avatar answered Sep 29 '22 21:09

Giovanni Marques