如何配置 Charles Proxy 和 Android 以便我可以查看 HTTPS 会话 [关闭]
2023-11-23
我想使用 Charles Proxy 在我的 Android 手机上查看 HTTPS 会话。我需要查看原始请求/响应内容以调试我的应用程序。我通过在“代理设置”-> SSL 选项卡下添加主机和端口来配置 Charles。当我运行该应用程序时,所有 SSL 调用似乎都很快从 Charles 中消失。有谁知道如何配置 Charles Proxy 和我的 Android 设备,以便它们能够协同工作? Charles 文档没有适用于 Android 设备的信息。
对于安卓7
参考:如何让 charles 代理与 Android 7 nougat 一起工作?
适用于Android7以下的Android版本
从您的计算机上运行 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.
在安卓手机中:
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
在“命名证书”中输入您想要的任何内容
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: