什么是NSExceptionDomains以及何时使用它?

时间:2016-11-08 03:12:49

标签: ios app-transport-security

iOS新手,具有网络编程功能。

请任何人帮助理解这一点?

  <key>NSExceptionDomains</key>
    <dict>
        <key><!-- your_remote_server.com / localhost --></key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <true/>
        </dict>
    <!-- add more domain here -->
    </dict>

1 个答案:

答案 0 :(得分:4)

Apple推出了App Transport Security(ATS),要求应用程序与服务器通信建立安全连接。作为临时措施,在所有应用程序和服务器都符合要求之前,它们允许您定义安全要求的例外。您可以在此处阅读更多内容:https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW35