NSURLSession/NSURLConnection HTTP load failed on iOS 9
Found solution:
In iOS9, ATS enforces best practices during network calls, including the use of HTTPS.
From Apple documentation:
ATS prevents accidental disclosure, provides secure default behavior, and is easy to adopt. You should adopt ATS as soon as possible, regardless of whether you’re creating a new app or updating an existing one. If you’re developing a new app, you should use HTTPS exclusively. If you have an existing app, you should use HTTPS as much as you can right now, and create a plan for migrating the rest of your app as soon as possible.
In beta 1, currently there is no way to define this in info.plist. Solution is to add it manually:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Update1: This is a temporary workaround until you're ready to adopt iOS9 ATS support.
Update2: For more details please refer following link:
http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/
Update3: If you are trying to connect to a host (YOURHOST.COM) that only has TLS 1.0
Add these to your app's Info.plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>YOURHOST.COM</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>
HTTPS request in iOS 9 : NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)
corresponds to the server not supporting "Forward Secrecy".
To work around this, add a domain exception to .plist file as follows:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>test.testdomain.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>
POST Value getting error in ios 9 (NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
Try to write this line without slash
NSURL * url = [NSURL URLWithString:@"https://www.indusaudio.com/WeeAudio/rest/files/downloadFile/en/linto/"];
to
NSURL * url = [NSURL URLWithString:@"http://www.indusaudio.com/WeeAudio/rest/files/downloadFile/en/linto/"];
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9801)
Just Add following Dict in info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>
Related Topics
How to Insert New Cell into Uitableview in Swift
Push Notification Issue With iOS 10
How to Detect Avplayer and Get Url of Current Video from Wkwebview
How to Pass Textfield Value to View Controller Through Button Click in Swift Ui
Iphone Hide Navigation Bar Only on First Page
Handling Applicationdidbecomeactive - "How Can a View Controller Respond to the App Becoming Active"
How to Add Text to an Image in iOS Swift
Returning Data from Async Call in Swift Function
Using Auto Layout in Uitableview For Dynamic Cell Layouts & Variable Row Heights
Transport Security Has Blocked a Cleartext Http
What Are Unwind Segues For and How to Use Them
How to Make a Uitextfield Move Up When the Keyboard Is Present - on Starting to Edit