0

Whenever I try to load a url or gain the data from a specific URL that follows the http:// format. Xcode returns me with this error

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

How can I fix/work my way around this

Jimmy lemieux
  • 439
  • 1
  • 5
  • 14

1 Answers1

1

I am not sure but you have to update your info.plist file by adding this key:

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

Or you can add it another way and it will look like:

enter image description here

Or you can add a specific domain like:

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSExceptionDomains</key>
  <dict>
    <key>yourserver.com</key>
    <dict>
      <!--Include to allow subdomains-->
      <key>NSIncludesSubdomains</key>
      <true/>
      <!--Include to allow HTTP requests-->
      <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
      <true/>
      <!--Include to specify minimum TLS version-->
      <key>NSTemporaryExceptionMinimumTLSVersion</key>
      <string>TLSv1.1</string>
    </dict>
  </dict>
</dict>

Original Post here for that.

Community
  • 1
  • 1
Dharmesh Kheni
  • 71,228
  • 33
  • 160
  • 165