NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802) error in https connection
As per the Apple tech note, App Transport Security requires SHA-2. The S3 (and CloudFront) certificates are using SHA-1, which is why this failure is occurring.
The workaround is to set the NSExceptionRequiresForwardSecrecy
to false
. (This is until AWS moves to SHA-2 (by September 30th, 2015)).
HTTP load failed in xcode version 9.3 ios 11 even after adding temporary exception on plist file
Here's the code from the linked answer in Swift. HTH.
class RequestHelper: NSObject, URLSessionDelegate {
func makeRequest(request: URLRequest, completionHandler: @escaping (Data?, URLResponse?, Error?) ->() ) {
let sessionConfiguration = URLSessionConfiguration.default
let session = URLSession(configuration: sessionConfiguration, delegate: self, delegateQueue: nil)
let task = session.dataTask(with: request) { data, response, error in
completionHandler(data, response, error)
}
task.resume()
}
func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition,
URLCredential?) -> () ) {
guard
challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust,
challenge.protectionSpace.host == "yourdomain.com",
let trust = challenge.protectionSpace.serverTrust
else {
return
}
let credential = URLCredential(trust: trust)
completionHandler(.useCredential, credential)
}
}
Making HTTPS request in iOS 9 with self-signed certificate
This issue was solved some time ago. It turned out to be invalid self-signed certificate. It didn't meet all requirements from Apple. Unfortunately i don't know, what exactly it was.
Related Topics
Uiwebview Random Crash at [Uiviewanimationstate Release]: Message Sent to Deallocated Instance
Firebase Dynamic Link Not Opening the App iOS
How to Select Range of Values When Using Arc4Random()
Using Custom Fonts in Interface Builder
Autolayout Multiline Uilabel Cutting Off Some Text
"'Cdvplugin.H' File Not Found" in Cordova as Component (Cleaver)
iPhone Uitextfield Background Color
App Submission Binary Does Not Show Up in Itunes Connect
iOS 6 Xcode 4.5 Unsupported Architecture Armv7S
How to Do a Live Uitextfield Count While Typing (Swift)
How to Downscale a Uiimage in iOS by the Data Size
Change Font of Back Navigation Bar Button
Uiview. Why Does a Subviews Outside Its Parent's Extent Not Receive Touches
Is There Function to Convert Uicolor to Hue Saturation Brightness
Modifying Ekparticipants (Attendees) in Eventkit Like Sunrise