您的位置:首页 > 大数据 > 人工智能

Error Domain=NSURLErrorDomain Code=-1022;使用AFNetWorking连接报错

2016-03-13 17:14 816 查看
Error Domain=NSURLErrorDomain Code=-1022

"The resource could not be loaded because the App Transport Security policy requires the use of a secure connection." UserInfo={NSUnderlyingError=0xxxxxxxxx {Error Domain=kCFErrorDomainCFNetwork Code=-1022 "(null)"}, NSErrorFailingURLStringKey=http://192.168.10.11:80822/service=token_request&validateStr=xxxx&uniqueKey=xxxx,
NSErrorFailingURLKey=http://192.168.10.11:8082/service=token_request&validateStr=xxxx&uniqueKey=xxxx, NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.}

iOS开发中依然使用http请求,而非https请求,必须要专门设置一下plist:

添加App Transport Security Settings, 展开后输入Allow Arbitrary Loads,值改成YES
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: