NSExceptionAllowsInsecureHTTPLoads 不适用于 IP 地址 [英] NSExceptionAllowsInsecureHTTPLoads not working for IP addresses

查看:33
本文介绍了NSExceptionAllowsInsecureHTTPLoads 不适用于 IP 地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 iOS 9 上排除 ATS 对我不起作用.

excluding ATS on iOS 9 doesn't work for me.

我有一个没有域名(只有 IP 地址)和 SSL 证书的测试服务器(所以它是 HTTP 而不是 HTTPS)

I have a test server which has no domain name (IP address only) and no SSL certificate (so it is HTTP and not HTTPS)

尝试过:

<key>52.24.145.252</key>
<dict>
    <key>NSExceptionAllowsInsecureHTTPLoads</key>
    <true/>
    <key>NSIncludesSubdomains</key>
    <true/>
</dict>

但我仍然收到错误:

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

我做错了什么?

推荐答案

您需要将 NSAppTransportSecurity 字典添加到您的 info.plist.然后加NSAllowsArbitraryLoads 该字典的键并将布尔值设置为 YES.

You need to add NSAppTransportSecurity dictionary to your info.plist. Then add NSAllowsArbitraryLoads key to that dictionary and set the boolean value to YES.

更新

自 2017 年 1 月起,如果您使用上述方法选择退出 ATS,您需要在将您的应用提交到 AppStore 时向 Apple 提供理由.

From 2017 January, if you are using the above mentioned method for opting-out from ATS you need to provide a justification to Apple while submitting your app to AppStore.

2017 年 1 月需要应用传输安全

这篇关于NSExceptionAllowsInsecureHTTPLoads 不适用于 IP 地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆