Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. - (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition,
  2. NSURLCredential *credential))completionHandler
  3. {
  4. if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust])
  5. {
  6. [TSKPinningValidator handleChallenge:challenge completionHandler:completionHandler];
  7. }
  8. else
  9. {
  10. // Handle alternative (non-SSL) authentication
  11. NSAssert(@"Unsupported authentication method");
  12. completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil);
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement