Reputation: 2578
I have a website that has traffic on both HTTP and HTTPS.
I develop an app (iOS 9) that call some of these URLs, but when I changed from HTTP to HTTPS I got the following error:
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
I have already disabled the ATS, because I have a facebook integration and it was complaining.
Here is my piece of code that makes the call, and handles the result:
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://myRestWebService?test=Y"]];
NSMutableURLRequest *request = [ NSMutableURLRequest requestWithURL:url];
NSError *error;
NSURLResponse *response;
NSData *myUrlData = [ NSURLConnection sendSynchronousRequest:request
returningResponse:&response
error:&error];
NSString *result = [[NSString alloc] initWithData:myUrlData encoding:NSUTF8StringEncoding];
As you can see, it is a synchronous call.
The certificate is signed by Go Daddy, so it is trusted, and works well on a browser.
Any advice would be appreciated.
Upvotes: 0
Views: 85
Reputation: 2578
I talked to Apple and turns out my apache had a problem. Their answer:
Configure your server to return its intermediate certificate in the TLS handshake. If you’re using Apache, you should look at the SSLCertificateChainFile directive.
So I set the intermediate certificate and everything start working.
Upvotes: 1