Last active
June 23, 2017 20:40
-
-
Save adamkaplan/f06775be49472747e448416230115a0f to your computer and use it in GitHub Desktop.
trustkit-discuss
This file contains 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)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, | |
NSURLCredential *credential))completionHandler | |
{ | |
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) | |
{ | |
[TSKPinningValidator handleChallenge:challenge completionHandler:completionHandler]; | |
} | |
else | |
{ | |
// This challenge was not for server trust. Fall back to default behavior. | |
NSAssert(@"Unsupported authentication method"); | |
completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil); | |
} | |
} |
This file contains 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)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, | |
NSURLCredential *credential))completionHandler | |
{ | |
if (![TSKPinningValidator handleChallenge:challenge completionHandler:completionHandler]) | |
{ | |
// TrustKit did not handle this challenge: perhaps it was not for server trust | |
// or the domain was not pinned. Fall back to the default behavior | |
completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment