Charles官网地址
如果有能力话还是支持下正版吧
官网下载安装Charles
第一步 代理设置
两种打开方式打开代理设置


点击后弹出代理设置页面
选择在8888端口上监听,然后确定.
勾选了SOCKS proxy,还能截获到浏览器的http访问请求.

确定后查看电脑ip地址
1.查看方法一

2.查看方法二
打开 - 系统偏好设置 - 网络

3.查看方法三
打开终端输入
ifconfig //inet的后面的就是本机的IP地址。
///ifconfig可以显示网络接口的网络参数,但是直接输入的话会显示一堆我们并不需要的数据,所以用grep进行过滤。
ifconfig | grep "inet " | grep -v 127.0.0.1

手机代理配置
在设置完Charles的代理和获取电脑IP地址后,现在配置手机的代理
保证手机和电脑连入同一局域网
在手机打开 设置 - 无线局域网 - 已连接的WiF - 配置代理 - 手动 - 存储

第二步 安装电脑端根证书:
help - ssl proxying - install charles root certificate

这时候会弹出一个根证书界面,如果没有弹出页面,可以选择 command + 空格 打开"钥匙串访问" , 会发现一个金黄色的证书 Charles Proxy CA 如下图所示,

[图片上传中...(SSL.png-d4a34d-1571365136388-0)]
双击打开证书 选择始终信任

第三步 配置SSL代理:
在charles的 Proxy选项选择SSL Proxy Settings
代理 - SSL代理设置 - 添加 - 主机 ( * ) - 端口 (443)
hsot为你要匹配的域名,*表示任意匹配
port为网页浏览端口号:填443 (为什么要填443我没查,有知道的大佬回复下,让我们涨涨知识)

第四步 安装SSL证书到手机设备

点击之后会弹出个提示框,让你在手机的浏览器中打开chls.pro.ssl 下载描述文件

下载好描述文件后进入 设置 - 已下载描述文件 - 安装 (右上角)
或者打开 设置 - 通用 - 描述文件 - Charles Proxy CA - 安装
第五步 信任证书 (重要:以前不知道,上面那些配置好后手机不能正常上网了,在其他教程里没看到这一步.)
打开 - 设置 - 通用 - 关于本机 - 证书信任设置 - 开启信任
到这里 就可以成功了


参考链接
Mac上Charles抓包iOS的https请求
Mac使用Charles进行HTTPS抓包
Mac上使用Charles抓取https
网友评论