NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9801)

♀尐吖头ヾ 提交于 2019-12-13 17:16:44

问题


So I have tried the fixes mentioned in the solutions that come up when I search for this issue but on Visual Studio I still get these issues for my iOS web view project. The android version works fine, but iOS does not load the web page properly.

Tried these fixes mainly: NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)

I've added this to my Info.plist file:

     <key>NSAppTransportSecurity</key>
      <dict>
            <key>NSExceptionDomains</key>
            <dict>
            <key>site.co.za</key>
            <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
            <true/>
           <key>NSAllowsArbitraryLoads</key>
           <true/>
         </dict>
         </dict>
        </dict>

Our site isn't secure but is there any way that I can bypass this so that I can load the mobile site properly like it does on Android?


回答1:


Just Add following Dict in info.plist:

<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSAllowsArbitraryLoadsInWebContent</key>
        <true/>
    </dict>


来源:https://stackoverflow.com/questions/43776859/nsurlsession-nsurlconnection-http-load-failed-kcfstreamerrordomainssl-9801

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!