iOS wkwebview https 載入不受信用的站點
- 2019 年 10 月 5 日
- 筆記
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
搞定,成功載入證書錯誤的站點