[Webkit-unassigned] [Bug 140197] WKWebView needs API to accept invalid SSL certificates

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 9 13:27:25 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=140197

Eugene But <eugenebut at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED

--- Comment #8 from Eugene But <eugenebut at chromium.org> ---
Thank you! The following code allows to accept an invalid cert in nightly WebKit build:

- (void)webView:(WKWebView *)webView
    didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
                    completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler {
  SecTrustRef serverTrust = challenge.protectionSpace.serverTrust;
  CFDataRef exceptions = SecTrustCopyExceptions(serverTrust);
  SecTrustSetExceptions(serverTrust, exceptions);
  CFRelease(exceptions);

  completionHandler(NSURLSessionAuthChallengeUseCredential,
                    [NSURLCredential credentialForTrust:serverTrust]);
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150109/358ec0df/attachment-0002.html>


More information about the webkit-unassigned mailing list