0

xcode 7 swift, I am using https for my webview, the app load the page sucessfully, but it said "2015-10-05 18:03:51.204 HKCateringApp[1326:45336] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9824)" Please help to solve it. Here with my code:

    let URL = NSURL(string: "https://www.ssls.com")

    WebView.loadRequest(NSURLRequest(URL: URL!))
Jose Ricardo Bustos M.
  • 8,016
  • 6
  • 40
  • 62
GPH
  • 1,111
  • 6
  • 29
  • 49

1 Answers1

1

You have to add just the NSAllowsArbitraryLoads key to YES in NSAppTransportSecurity dictionary in your info.plist file. Something new in iOS 9.0, So you have to do this.

For example,

 <key>NSAppTransportSecurity</key>
 <dict>
      <key>NSAllowsArbitraryLoads</key>
     <true/>
 </dict>
Alvin Varghese
  • 842
  • 10
  • 33
  • Could you please guide me how to do it? I am new to use xcode and couldn't find NSAppTransportSecurity – GPH Oct 05 '15 at 12:18
  • See, This Tutorial -> http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ || http://i.stack.imgur.com/CnBlN.png – Alvin Varghese Oct 06 '15 at 04:50
  • You will not find the key NSAppTransportSecurity. You have to manually paste it there and enter, And save its value to YES. And thats it. – Alvin Varghese Oct 06 '15 at 04:50
  • open Info.plist as source and paste inside main ... – djdance Jan 05 '16 at 20:29