找到解决方案:
在iOS9中,ATS在网络通话期间实施最佳实践,包括使用HTTPS.
From Apple documentation:
ATS prevents accidental disclosure, provides secure default behavior, and is easy to adopt. You should adopt ATS as soon as possible, regardless of whether you’re creating a new app or updating an existing one. If you’re developing a new app, you should use HTTPS exclusively. If you have an existing app, you should use HTTPS as much as you can right now, and create a plan for migrating the rest of your app as soon as possible.个
在测试版1中,目前没有办法在info.plist中定义这一点.解决方案是手动添加:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Update1: This is a temporary workaround until you're ready to adopt iOS9 ATS support.
Update2:有关更多详细信息,请参阅以下链接:
http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/个
如果您try 连接到仅具有TLS 1.0的主机(YOURHOST.COM),则为Update3:
将这些添加到应用程序的信息中.普利斯特
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>YOURHOST.COM</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>