OGeek|极客世界-中国程序员成长平台

标题: ios - App Transport Security 不再适用于 iOS 11 Xcode 9 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 15:52
标题: ios - App Transport Security 不再适用于 iOS 11 Xcode 9

我一直在开发一个应用程序...由于禁用 ATS 的 iOS 11 更新不再起作用,我在 info.plist 中添加了以下内容

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

我无法使用域异常键,因为我正在从未知域下载图像。 以下是我尝试下载图片时得到的结果

Task <C3DC30F1-5869-46F6-ABA4-5E1EC8334FD8>.<0> HTTP load failed (error code: -1005 [4:-4])
NSURLConnection finished with error - code -1005



Best Answer-推荐答案


我知道 IOS 11 不再支持以下内容:

添加以下我们可以绕过ATS(App Transport Security)错误:

<key>NSAppTransportSecurity</key> <dict>
     <key>NSExceptionDomains</key>
     <dict>
         <key>mydomain.com</key>
         <dict>
             <!--Include to allow subdomains-->
             <key>NSIncludesSubdomains</key>
             <true/>
             <key>NSExceptionRequiresForwardSecrecy</key>
             <false/>
         </dict>
     </dict> </dict>

引用链接:iOS 11 ATS (App Transport Security) no longer accepts custom anchor certs?

关于ios - App Transport Security 不再适用于 iOS 11 Xcode 9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47300932/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4