In iOS9, Apple added a new feature called Application Transport Security (ATS).
ATS applies best practices during network calls, including the use of HTTPS.
Apple Documentation Before Release:
ATS prevents accidental disclosure, provides secure default behavior, and is easy to accept. You should accept ATS as soon as possible, regardless of whether you are creating a new application or an existing one.
If you are developing a new application, you should use exclusively HTTPS. If you have an existing application, you should use HTTPS as much as you can right now, and create a migration plan for the rest of your application as soon as possible.
Add the link below to your info.plist and then take a look.
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
Even you can add a specific exception,
<key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>testdomain.com</key> <dict> <key>NSIncludesSubdomains</key> <false/> <key>NSExceptionAllowInsecureHTTPSLoads</key> <false/> <key>NSExceptionRequiresForwardSecrecy</key> <true/> <key>NSExceptionMinimumTLSVersion</key> <string>TLSv1.2</string> <key>NSThirdPartyExceptionAllowInsecureHTTPSLoads</key> <false/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <true/> <key>NSThirdPartyExceptionMinimumTLSVersion</key> <string>TLSv1.2</string> <key>NSRequiresCertificateTransparency</key> <false/> </dict> ... </dict> </dict>
Nilesh Patel Jul 06 '15 at 4:34 2015-07-06 04:34
source share