Skip to content

Instantly share code, notes, and snippets.

@jamesmbeams
Created March 13, 2013 19:20
Show Gist options
  • Save jamesmbeams/5155230 to your computer and use it in GitHub Desktop.
Save jamesmbeams/5155230 to your computer and use it in GitHub Desktop.
To allow Cordova (iOS) to connect to HTTPS with a self signed certificate, paste this at the bottom of AppDelegate.m NOTE: Only for testing, remember to remove it before submitting to the App Store, as I hear it could cause the app to be rejected.
@implementation NSURLRequest (ServiceClient)
+ (BOOL) allowsAnyHTTPSCertificateForHost:(NSString *) host
{
return YES;
}
@end
@Dbuggerx
Copy link

Dbuggerx commented Oct 4, 2015

I know this is old, but I'd like to thank you for this! Really saved my day!

@PeterStegnar
Copy link

PeterStegnar commented Oct 16, 2017

Please note that this does not works in iOS 11 anymore (WKWebview).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment