Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS9 - HTTP Connection Error

I got 3 error when i update my Xcode

1- App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

2- CFNetwork SSLHandshake failed (-9824)

3- NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9824)

I tried:

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSExceptionDomains</key>
  <dict>
    <key>yourdomain.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>

and

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

But they didn't work. Can anyone help me please! Thank You.

like image 878
Ibrahim BOLAT Avatar asked Oct 14 '15 13:10

Ibrahim BOLAT


2 Answers

From Project Navigator click your project's name. enter image description here

Now, on the right side you' ll see the General Tab of your project.Select the Info Tab enter image description here Expand the Customs iOS Target Properties enter image description here Add a new type, Name it as NSAppTransportSecurity, type as Dictionary.It will be convert in this text App Transport Security Settings enter image description here Inside that add a new item and name it as NSAllowsArbitraryLoads, type as Boolean, value YES. enter image description here

See this thread on the forums for the further details what apple... Add the entry to info.plist

https://forums.developer.apple.com/message/5857#5857

And refer to Session 711 at WWDC. https://developer.apple.com/videos/wwdc/2015/?id=711

like image 92
umairhhhs Avatar answered Nov 03 '22 13:11

umairhhhs


add to the whitelist

enter image description here Connect the wrong domain name was added to the whitelist, even if the domain name has been used for https.

like image 3
EchoXuan Avatar answered Nov 03 '22 14:11

EchoXuan