1

我收到这些错误

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

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

4

1 回答 1

4

Kingfisher 似乎使用自定义方式来访问 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)])
于 2017-08-16T07:50:44.000 回答