
我用iOS 5(sdk:5.0 / xcode:4.2 Build 4D199)重新编译我的应用程序,https连接失败并显示错误消息(与禁用https相同的调用正常):
Error Domain=ASIhttpRequestErrorDomain Code=1 "A connection failure occurred" UserInfo=0xa8e66e0 {NSUnderlyingError=0xa8ac6c0 "The operation Couldn’t be completed. (Osstatus error -9844.)",NSLocalizedDescription=A connection failure occurred} 启用调试日志:
[STATUS] Starting asynchronous request <ASIFormDataRequest: 0xd96fc00>[CONNECTION] Request <ASIFormDataRequest: 0xd96fc00> will not use a persistent connection[STATUS] Request <ASIFormDataRequest: 0xd96fc00>: Failed[CONNECTION] Request #(null) Failed and will invalIDate connection #(null)
我发现这个相关帖子:
https://devforums.apple.com/message/537440#537440
这可以解释我的问题.
基于iOS 5喜欢TLS 1.2的想法,我尝试在AIhttpRequest.m中更改设置kcfStreamSocketSecurityLevelTLSv1
NSDictionary *sslPropertIEs = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithBool:YES],kcfStreamSSLAllowsExpiredCertificates,[NSNumber numberWithBool:YES],kcfStreamSSLAllowsAnyRoot,[NSNumber numberWithBool:NO],kcfStreamSSLValIDatesCertificateChain,kcfNull,kcfStreamSSLPeername,kcfStreamSocketSecurityLevelTLSv1,kcfStreamSsllevel,// my modif nil];
没有成功.也许我的修改是不正确的?
细节:
>我的ARC被禁用了
>我使用libz.1.2.5.dylib
>一周前我更新了ASIhttpRequest.
我不知道问题是证书故事(如TLS版本)还是其他内容.
任何帮助/想法是欢迎!
解决方法 这是最终的解决方案:https://developer.apple.com/library/ios/#technotes/tn2287/_index.html#//apple_ref/doc/uid/DTS40011309
NSDictionary *sslPropertIEs = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithBool:YES],@"kcfStreamSocketSecurityLevelTLSv1_0SSLv3",nil];
添加此参数:
@"kcfStreamSocketSecurityLevelTLSv1_0SSLv3",总结
以上是内存溢出为你收集整理的objective-c – iOS 5:https(ASIHTTPRequest)停止工作全部内容,希望文章能够帮你解决objective-c – iOS 5:https(ASIHTTPRequest)停止工作所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)