zoukankan      html  css  js  c++  java
  • iOS wkwebview https 加载不受信用的站点

    iOS 9.0以上直接设置WKNavigationDelegate代理

        func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge,
                     completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
            let cred = URLCredential.init(trust: challenge.protectionSpace.serverTrust!)
            completionHandler(.useCredential, cred)
        }
    

      引用一下

    self.wk.navigationDelegate = self
    

      搞定,成功加载证书错误的站点

  • 相关阅读:
    11.10
    11.9
    11.8 总结
    11.7
    11.6
    日报10.6
    日报10.5
    每周总结-3
    日报10.4
    日报10.2
  • 原文地址:https://www.cnblogs.com/jiajin/p/6562228.html
Copyright © 2011-2022 走看看