iOS设备安装证书
最后我们还需要在iOS设备上安装证书。点击 Charles 的顶部菜单,选择 Help –> SSL Proxying–> Install Charles Root Certificate on a Mobile Device or Remote Browser,然后就可以看到 Charles 显示如下弹窗:
失败请求的处理
iOS10.3之后,在上述设置完成之后,所有的https请求都会失败。提示错误:Failure SSLHandshake: Received fatal alert: unknown_ca 和You may need to configure your browser or application to trust the Charles Root Certificate.
原因:charles的根证书虽然已经在安装列表中,但在iOS 10.3之后,安装新的自定义证书默认是不受信任的。如果要信任已安装的自定义证书,需要手动打开开关以信任证书。
解决:设置->通用->关于本机->证书信任设置-> 找到charles proxy custom root certificate然后信任该证书即可. 模拟器也是这样处理。
四、使用Charles遇到的问题
我在使用Charles抓包https之后,在使用applicationLoader上传ipa包的时候遇到了下面的问题:
Communication error. Please use diagnostic mode to check connectivity. You need to have outbound access to TCP port 443.