Skip to content

Instantly share code, notes, and snippets.

@tigi44
Last active January 26, 2021 03:08
Show Gist options
  • Save tigi44/aad7e2c4372643c741daac24c24f8b1e to your computer and use it in GitHub Desktop.
Save tigi44/aad7e2c4372643c741daac24c24f8b1e to your computer and use it in GitHub Desktop.
wkwebview - ignore web auth (ssl..)
- (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler
{
NSURLSessionAuthChallengeDisposition disposition = NSURLSessionAuthChallengeUseCredential;
NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
if (completionHandler)
{
completionHandler(disposition, credential);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment