Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am kgutteridge on github.
  • I am kgutteridge (https://keybase.io/kgutteridge) on keybase.
  • I have a public key whose fingerprint is 81BE 9A16 C429 5A19 A29A 1294 85D7 D3C2 0EEE 7A04

To claim this, I am signing this object:

@kgutteridge
kgutteridge / gist:3690698
Created September 10, 2012 12:43
Accept the world (this really isn't a good idea)
//HERE BE DRAGONs don't use this in production!
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
NSArray *trustedHosts = [NSArray arrayWithObjects:@"api.parse.com", nil];
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust])
{
if ([trustedHosts containsObject:challenge.protectionSpace.host])
{
[challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge];