Search code examples
iosssl-certificateapp-transport-security

iOS9 getting error “an SSL error has occurred and a secure connection to the server cannot be made”


Since I upgraded my existing project with iOS 9, I keep getting the error :

An SSL error has occurred and a secure connection to the server cannot be made.


Solution

  • For the iOS9, Apple made a radical decision with iOS 9, disabling all unsecured HTTP traffic from iOS apps, as a part of App Transport Security (ATS).

    To simply disable ATS, you can follow this steps by open Info.plist, and add the following lines:

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