美文网首页swift中的小tips
WKWebview加载自签名证书https网页

WKWebview加载自签名证书https网页

作者: 严青_ | 来源:发表于2019-12-24 18:43 被阅读0次

    验证自签名证书全过

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

    相关文章

      网友评论

        本文标题:WKWebview加载自签名证书https网页

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