【发布时间】:2016-01-22 08:45:33
【问题描述】:
我正在尝试修复 CFNetwork SSLHandshake failed (-9806) 警告。 我的应用程序运行良好,但是当我在设备中通过 Xcode 运行应用程序时,应用程序崩溃了。 我在 .plist 中添加了 NSAppTransportSecurity,
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>yourserver.com</key>
<dict>
<!--Include to allow subdomains-->
<key>NSIncludesSubdomains</key>
<true/>
<!--Include to allow insecure HTTP requests-->
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<!--Include to specify minimum TLS version-->
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>
还使用不同的 3g/wifi 进行了测试。
需要帮助。提前致谢。
【问题讨论】:
-
崩溃与 ATS 有关吗?请添加异常消息。
-
我正在使用 AFNetworking 。我认为崩溃是由于网络问题,与 ATS 无关,但由于堆栈溢出的一些建议,我正在使用 ATS 来防止实时崩溃
标签: ios objective-c cfnetwork