美文网首页
WKWebView 证书认证

WKWebView 证书认证

作者: sttech | 来源:发表于2017-06-01 16:40 被阅读0次

-(void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler
{
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {

    NSURLCredential *card = [[NSURLCredential alloc]initWithTrust:challenge.protectionSpace.serverTrust];
    
    completionHandler(NSURLSessionAuthChallengeUseCredential,card);
}

// if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
// if ([challenge previousFailureCount] == 0) {
// NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
// completionHandler(NSURLSessionAuthChallengeUseCredential, credential);
// } else {
// completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
// }
// } else {
// completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
// }
}

http://blog.csdn.net/aajunwang/article/details/51008526

相关文章

  • WKWebView 证书认证

    -(void)webView:(WKWebView *)webView didReceiveAuthenticat...

  • 网络

    认证 ssl/tls 1.客户端证书认证 (TLS双向认证) CA #证书认证2.bearerToken3.Se...

  • 认证证书和认证标志管理办法

    认证证书和认证标志管理办法第一章总则第一条 为加强对产品、服务、管理体系认证的认证证书和认证标志(以下简称认证证书...

  • 2022-03-30

    iOS问题记录 WKWebView加载不受信任网页链接 实现WKWebView代理方法,调过证书校验 - (voi...

  • 第一次数据库笔记

    认证方面: 目前认可度比较高的认证基本都是oracle的,包括OCA证书、OCP证书、OCM证书,级别由低到高,难...

  • iOS通过AFNetworking实现HTTPS双向认证

    1. 添加认证证书 2. 校验证书

  • 认证

    基本权限认证分为OAuth认证,摘要认证和基本认证,证书认证,表单认证 OAuth 认证流程详解: 摘抄自:htt...

  • 终极武器——数字证书

    数字证书也称电子证书,由数字证书颁发认证机构(CA)签发才具备可认证性。数字证书采用了公钥基础设施(PKI),使用...

  • CCC证书注销和暂停管理规定

    认证证书注销 1、认证证书有效期满、未申请延期使用。 2、工厂倒闭、产品不再生产、认证委托人主动放弃效率保持认证证...

  • WKWebView 证书问题

    转载地址:https://www.shiqidu.com/d/692[https://www.shiqidu.co...

网友评论

      本文标题:WKWebView 证书认证

      本文链接:https://www.haomeiwen.com/subject/vtujfxtx.html