我正在构建一个网络浏览器,但在网络方面我真的是新手。
我想测试下面的代码示例,但我没有现实生活中的示例可以使用:
- (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler
{
CFDataRef exceptions = SecTrustCopyExceptions(challenge.protectionSpace.serverTrust);
SecTrustSetExceptions(challenge.protectionSpace.serverTrust, exceptions);
CFRelease(exceptions);
completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]);
}
谁能提供一个 URL,我可以在其中测试上面的代码?
Edit:我开始赏金是因为我感到筋疲力尽。我正在完成我创建的应用程序,每天都会出现很多问题。我真的很感激您的帮助!
@Vulkan 请使用此链接检查您的代码。
http://samvermette.com http://samvermette.com
我已经使用了这个链接https://github.com/TransitApp/SVWebViewController https://github.com/TransitApp/SVWebViewController
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)