我正在使用iOS 10 beta 8,Xcode 8 beta 6。

关于Apple Transport Security(ATS),我发现使用“exception domains”在iOS10中不起作用,但是“允许任意加载”。还有其他人确认吗?

security - iOS 10 : Apple transport security  "exception domains" no longer working-LMLPHP

(我已从图像中删除了域名;这是一个企业应用程序,不受忽略ATS异常的应用商店的影响)

最佳答案

异常域方法对我有效。
Xcode 8.21,Mac OS 10.12.3和React-native 0.42.3。

按如下所示在xcode或文本编辑器模式下修改plist后,应关闭终端和模拟器并重新启动它。

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>example1.com</key>
        <dict>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
            <key>NSIncludesSubdomains</key>
            <true/>
        </dict>
        <key>example2.org</key>
        <dict>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
            <key>NSIncludesSubdomains</key>
            <true/>
        </dict>
    </dict>
    <key>NSAllowsLocalNetworking</key>
    <true/>
</dict>

10-07 19:03
查看更多