2017-08-16 41 views
0

林的電話試圖從具有不可信證書web服務加載圖像時遇到這些錯誤iOS的安全異常(-9813)只翠鳥圖書館

[] nw_coretls_callback_handshake_message_block_invoke_3 tls_handshake_continue: [-9812] 
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813) 

。我已經將我的項目info.plist配置爲 this,它對Web服務的「正常」請求起作用。但只要Kingfisher-Lib提出請求,我就會得到這個錯誤。這是爲什麼?

回答

0

翠鳥似乎使用自定義的方式訪問該網址。解決方案是將主機手動配置爲可下載的可信任主機:

let downloader = KingfisherManager.shared.downloader //Downloader needs to be configured to accept untrusted certificates 
    downloader.trustedHosts = Set(["your_untrusted_certificate_host"]) 
imageView.kf.setImage(with: URL(string: "\(applicationSession.environment.systemUrl!)\(path)"), placeholder: #imageLiteral(resourceName: "noImageImage"), options: [.requestModifier(modifier), .downloader(downloader)])