我收到这些错误

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

尝试从具有不受信任的证书的Web服务加载图像时。我已经将项目info.plist配置为
this,它确实可以处理对Web服务的“正常”请求。但是,一旦Kingfisher-Lib发出请求,我就会收到此错误。这是为什么?

最佳答案

翠鸟似乎使用一种自定义方式来访问URL。解决方案是将主机手动配置为可下载的主机:

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)])

关于ios - iOS安全异常(exception)(-9813)仅来自翠鸟库的调用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/45706550/

10-11 17:56