NSURLSession/NSURLConnection HTTP 加载失败(kCFStreamErrorDomainSSL,-9814)
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9814)
我已经在这个项目上工作了一个月,直到今天所有互联网请求都工作正常,每当我执行请求时我都会看到这个错误:
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9814)
尽管在我的 info.plist 中,我从一开始就添加了 APT 配置:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
请记住,一切正常,我没有做任何更改。
我在 iOS 9 和 iOS 7 上试过这个,我得到了同样的错误。
在 info.plist、
试试这个
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>YOURHOST.COM</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
并参考 了解更多详情。希望这会有所帮助:)
我已经在这个项目上工作了一个月,直到今天所有互联网请求都工作正常,每当我执行请求时我都会看到这个错误:
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9814)
尽管在我的 info.plist 中,我从一开始就添加了 APT 配置:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
请记住,一切正常,我没有做任何更改。 我在 iOS 9 和 iOS 7 上试过这个,我得到了同样的错误。
在 info.plist、
试试这个<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>YOURHOST.COM</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
并参考