I'm switching from iOS8 to iOS9 and AFNetworking web service calls over HTTPS that worked before no longer work. I'm getting error -1200
and error -9824
The issue is related to using self-signed certificates.
Error Domain=kCFErrorDomainCFNetwork Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSErrorFailingURLStringKey=[server url], NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFNetworkCFStreamSSLErrorOriginalValue=-9824
I see this related question: IOS9 SSL error with NSURLSession, with the following answer, however, the answer is cryptic and does not really tell me how to fix the issue.
ATS trusts only certificate signed by a well known CA, all others are rejected. As a consequence the only solution with a Self signed certificate is to set anexception with NSExceptionDomains.
What is the proper way to update AFNetworking calls to work with HTTPS on iOS9?
In the past I've used numerous workarounds, including a way to respond to NSURLAuthenticationChallenge
, however I'm looking for something more definitive.