首页 文章

将域异常添加到App Transport Security ios9 [重复]

提问于
浏览
0

这个问题在这里已有答案:

我在plist中使用以下代码将我的服务器异常添加到App Transport Security协议 .

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>172.16.4.139</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <true/>
            <key>NSExceptionMinimumTLSVersion</key>
            <string>TLSv1.2</string>
            <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
            <false/>
            <key>NSThirdPartyExceptionMinimumTLSVersion</key>
            <string>TLSv1.2</string>
            <key>NSRequiresCertificateTransparency</key>
            <false/>
        </dict>
    </dict>
</dict>

但它正在发出消息“ The resource could not be loaded because the App Transport Security policy requires the use of a secure connection. ” .

我做错了什么?

1 回答

  • 2

    硬编码的IP地址在iOS 9中不起作用 .

    检查this answer .

相关问题