iOS 9,10 NSURLSession / NSURLConnection HTTP加载失败(kCFStreamErrorDomainSSL,-9801)

时间:2017-02-22 17:48:57

标签: ios objective-c ssl

我在iOS 9和iOS 10上收到此错误。

2017-02-22 18:38:44.955295 xxxxxx[8511:301107] [] nw_coretls_read_one_record tls_handshake_process: [-9801] 2017-02-22 18:38:44.958 xxxxxx[8511:301106] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9801)

这是我的NSAppTransportSecurity配置。我把我发现的关于这个问题的所有内容都放了:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionAllowsInsecureHTTPLoads</key>
    <true/>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <key>NSExceptionDomains</key>
    <dict>
        <key>domain1</key>
        <dict>
            <!--Include to allow subdomains-->
            <key>NSIncludesSubdomains</key>
            <true/>
            <!--Include to allow insecure HTTP requests-->
            <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <!--Include to specify minimum TLS version-->
            <key>NSTemporaryExceptionMinimumTLSVersion</key>
            <string>TLSv1.1</string>
            <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
        <key>domain2</key>
        <dict>
            <!--Include to allow subdomains-->
            <key>NSIncludesSubdomains</key>
            <true/>
            <!--Include to allow insecure HTTP requests-->
            <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <!--Include to specify minimum TLS version-->
            <key>NSTemporaryExceptionMinimumTLSVersion</key>
            <string>TLSv1.1</string>
            <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
    </dict>
</dict>

我把它们都放了,我不知道它为什么还没有用。

0 个答案:

没有答案