Created
May 22, 2015 16:08
-
-
Save edwardmp/817a50d623310f159c88 to your computer and use it in GitHub Desktop.
Allow use of self signed SSL certificate when using NSURLSession
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler | |
{ | |
completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment