ios – 如何让Charles在SSL连接上使用Xcode 7?

前端之家收集整理的这篇文章主要介绍了ios – 如何让Charles在SSL连接上使用Xcode 7?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我遇到了新安装的 Xcode 7的问题,即使在通过Charles在iOS模拟器上安装SSL证书(帮助> SSL代理>在iOS模拟器中安装Charles Root证书),并明确允许服务器的域我在查尔斯查询,任何试图收听SSL流量的尝试都会导致连接失败.

Charles报告以下错误

SSLHandshake: Remote host closed connection during handshake You may@H_502_6@ need to configure your browser or application to trust the Charles@H_502_6@ Root Certificate. See SSL Proxying in the Help menu.

Xcode控制台报告:

2015-09-23 11:29:44.173 Citifyd[8352:449043] Error in registration.@H_502_6@ Error: Error Domain=NSCocoaErrorDomain Code=3010@H_502_6@ “REMOTE_NOTIFICATION_SIMULATOR_NOT_SUPPORTED_NSERROR_DESCRIPTION”@H_502_6@ UserInfo={NSLocalizedDescription=REMOTE_NOTIFICATION_SIMULATOR_NOT_SUPPORTED_NSERROR_DESCRIPTION}@H_502_6@ 2015-09-23 11:29:44.483 Citifyd[8352:449381]@H_502_6@ NSURLSession/NSURLConnection HTTP load Failed@H_502_6@ (kcfStreamErrorDomainSSL,-9802) 2015-09-23 11:29:44.509@H_502_6@ Citifyd[8352:449043] API ERRROR Error Domain=NSURLErrorDomain@H_502_6@ Code=-1200 “An SSL error has occurred and a secure connection to the@H_502_6@ server cannot be made.”

Xcode 6在相同的设置下运行良好 – 任何人都有任何想法?

解决方法

我基于这个帖子解决了这个问题: @H_502_6@ https://forums.developer.apple.com/thread/4988

iOS 9(Xcode 7模拟器运行)对SSL传输有更严格的要求 – 来自上述线程中的用户“Poets”:

iOS 9 forces connections that are using HTTPS to be TLS 1.2 to avoid@H_502_6@ recent vulnerabilities. In iOS 8 even unencrypted HTTP connections@H_502_6@ were supported,so that older versions of TLS didn’t make any problems@H_502_6@ either. As a workaround,you can add this code snippet to your@H_502_6@ Info.plist:

<key>NSAppTransportSecurity</key>  
  <dict>  
  <key>NSAllowsArbitraryLoads</key>  
  <true/>  
</dict>

这使Charles能够在使用iOS 9仿真器时向您显示未加密的流量.分发应用后,您可能希望禁用此功能.

猜你在找的iOS相关文章