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

旧时模样 提交于 2019-12-20 09:16:07

问题


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?


回答1:


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




回答2:


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.




回答3:


You need to set the proxy settings (IP and port) not using the emulator sidebar but inside the actual settings of Android that runs on the emulator. Just long tap on the Wifi network named AndroidWifi and then Modify network. Set the IP to your local computer's IP and port to 8888. Setting an APN is not needed!



来源:https://stackoverflow.com/questions/33724755/charles-proxy-ssl-connections-wont-show-hostnames-only-ips

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!