zoukankan      html  css  js  c++  java
  • ios wkwebview didReceiveAuthenticationChallenge crash解决

    //需要响应身份验证时调用 同样在block中需要传入用户身份凭证

    //现在就是不进行https验证了 然后就闪退不了了

    - (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler{

        

        if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {

            

            NSURLCredential *card = [[NSURLCredential alloc]initWithTrust:challenge.protectionSpace.serverTrust];

            

            completionHandler(NSURLSessionAuthChallengeUseCredential,card);

        }

    }

    对上述的代码,有任何疑问,可以在下方留言。 也可以给我发邮件咨询:673658917@qq.com 或者是直接加qq:673658917 转载请注明出处,谢谢合作。 睡觉舒服,那是给死人准备的,加油吧,一年后你会感谢现在的自己的。
  • 相关阅读:
    跨域通信
    Http协议-报文
    从快递公司作业模式看网络通信
    xx.exe 中的 0x7c92e4df 处最可能的异常: 0xC0000008: An invalid handle was specified
    [wp8游戏] cocos2d-x v2.2 + VS2013 环境搭建
    wp加载本地HTML(附带图片,CSS,JS)
    谈谈.NET程序集(一)
    [读书心得] .NET中 类型,对象,线程栈,托管堆在运行时的关系
    矩估计与最大似然估计
    WP8开发札记(二)让程序支持锁屏运行
  • 原文地址:https://www.cnblogs.com/lishanshan/p/11044954.html
Copyright © 2011-2022 走看看