问题描述
当我在一段时间后打开我的应用程序时,我收到了日志:
When I open my application after a while, I received log:
它从未出现在过去。
我的项目使用网络库AFNetworking和CocoaAsyncSocket。
It has never been out in the past.My project uses a network library AFNetworking and CocoaAsyncSocket.
为什么会出现以及如何修复它?
Why does it occur and how to fix it?
推荐答案
我解决了我的情况,这不是AFNetwork的问题,我使用无效的SSL认证和SDWebImage,当在SDWebImage中使用选项'SDWebImageAllowInvalidSSLCertificates'并获得一个http图像(不是https image),你会收到这个错误。 SDWebImage无法自动识别协议(http或https)。
I solved my situation, it is not AFNetwork's issue, I use a invalid SSL certification and SDWebImage, when use the option 'SDWebImageAllowInvalidSSLCertificates' in SDWebImage and get a http image (not https image), you will get this error. the protocol (http or https) not being recognized automaticly by SDWebImage.
我的解决方案:
我没有更改SDWebImage的代码,我只是为已识别的协议(http或https)编写了一个包装器。
我对http图像使用'0'选项,对https图像使用'SDWebImageAllowInvalidSSLCertificates'选项(我的https认证是自签名或无效的)。如果您的cer有效,我认为SDWebImage效果很好。
my solution:I not change SDWebImage’s code, I just write a wrapper for recognized protocol (http or https). I use '0' option for http images and 'SDWebImageAllowInvalidSSLCertificates' option for https images (my https certification is self signed or invalid). If yours cer is valid , I think SDWebImage works well.
这篇关于CFNetwork内部错误:URLConnectionLoader.cpp:289的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!