您的位置:首页 > 理论基础 > 计算机网络

一个IOS9 网络问题

2015-06-14 12:24 495 查看


一个IOS9 网络问题

在ios9下,使用afnetworking执行http请求(http://apitest.XXX.com/Login),但是一直返回的是error

Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo=0x7ffad9c498b0 {_kCFStreamErrorCodeKey=-9806, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?,
NSUnderlyingError=0x7ffadba9ae40 "An SSL error has occurred and a secure connection to the server cannot be made.", NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://apitest.XXX.com/Login,
NSErrorFailingURLStringKey=iption=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://apitest.XXX.com/Login, _kCFStreamErrorDomainKey=3}

报错说ssl的问题,但是我访问的是http啊,不是https

在ios8运行就没有这个问题,求解这是个什么情况啊

在info.plist文件里面手动添加 NSAppTransportSecurity, NSAllowsArbitraryLoads,应该就可以了,参考图片

图片:nGw3j.png

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: