因此,昨晚发布的新的iOS测试版SDK有“”,它鼓励开发人员使用https而不是http。原则上,这是一个很好的想法,我已经在我们的阶段/生产环境中使用了https。然而,当iOS应用程序连接到我在笔记本上运行的web服务时,我没有在本地开发环境中设置https。
从今天上午的情况来看,URL加载系统将决定使用https,即使您向它传递了一个http URL。有谁知道如何禁用这种行为--即使是针对特定的URL?
发布于 2015-06-10 08:54:51
作为公认的答案提供了所需的信息,以及更多关于使用和disabling App Transport Security one can find more on this的信息。
对于每个域异常,将它们添加到Info.plist中。
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>yourserver.com</key>
<dict>
<!--Include to allow subdomains-->
<key>NSIncludesSubdomains</key>
<true/>
<!--Include to allow HTTP requests-->
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<!--Include to specify minimum TLS version-->
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>,但如果我不知道需要使用的所有不安全域怎么办?在Info.plist中使用以下键
<key>NSAppTransportSecurity</key>
<dict>
<!--Include to allow all connections (DANGER)-->
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>For more detail you can get from this link.
https://stackoverflow.com/questions/30731785
复制相似问题