I am trying to post to a server that supports TLS 1.2 -- at least when I perform a GET in a browser I can verify that the communication uses TLS 1.2 and that the cert is validated by a cert authority. However, when I try to POST in my code to that server using AFNetworking iOS 9.0 (13A4305g) / Xcode 7-beta4 I'm getting a handshake failure.
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.requestSerializer = [AFHTTPRequestSerializer serializerWithContentType:@"application/x-www-form-urlencoded"];
manager.responseSerializer = [AFJSONResponseSerializer serializer];
[manager POST:requestString parameters:@{ @"apiKey" : MY_API_KEY,
@"payload" : [MyParams paramsForPOSTAsJSON] }
success:^(AFHTTPRequestOperation *operation, NSDictionary *responseDict) {
...
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
myLog(@"Communication failed: %@", error);
}];
The failure:
2015-08-06 15:01:08.398 MyApp[1795:394055] CFNetwork SSLHandshake failed (-9824)
2015-08-06 15:01:08.409 MyApp[1795:394055] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9824)
2015-08-06 15:01:08.412 MyApp[1795:393999] MyClass sendDataToServer Communication failed: Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." ...
Am I missing something? How can I dig deeper? Suppose it is a problem with the server and not the code - how could I snoop that?