背景
mac os 使用charles 抓包后,模拟器的报文跟踪出现问题,代码提示:
Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “cdn-settings.segment.com” which could put your confidential information at risk.
有很多 CONNECT
的报文被charles捕捉到。
报文有提示:SSL Proxying not enabled for this host: enable in Proxy Settings, SSL locations
OR You may need to configure your browser or application to trust the Charles Root Certificate. See SSL Proxying in the Help menu.
or SSL handshake with client failed - Remote host terminated the handshake
解决方案
在模拟器上安装证书,网站chls.pro/ssl