Skip to content

Instantly share code, notes, and snippets.

@raimon49
Created May 26, 2015 13:02
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save raimon49/8e1945359a16b49aef50 to your computer and use it in GitHub Desktop.
Save raimon49/8e1945359a16b49aef50 to your computer and use it in GitHub Desktop.
Ignoring certificate errors with NSURLConnection
@implementation NSURLRequest(OOA)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host {
return YES;
}
@end
extension NSURLRequest {
statuc func allowsAnyHTTPSCertificateForHost(host: String) -> Bool {
return true
}
}
@sebirkli
Copy link

sebirkli commented Mar 9, 2016

change statuc to static in the swift version

@fnc12
Copy link

fnc12 commented Apr 20, 2017

doesn't work with iOS 8 SDK

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