When developing with Cordova for iOS, you often make Ajax requests to SSL-encrypted hosts, such as APIs.
Sometimes, these SSL certificates are not valid (or self signed), so iOS breaks the call and sends out an error message to the console in xcode.
nw_coretls_callback_handshake_message_block_invoke_3 tls_handshake_continue: [-9814] DATE appname[64744:23296315] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9814)
To get around this error, we can tell iOS to simply ignore invalid certificates.
Open the file yourproject/platforms/ios/appname/Classes/AppDelegate.m and insert the following code at the end:
@implementation NSURLRequest(DataController) + (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host { return YES; } @end
Then run the app from xcode or cordova to check whether it is working now.