Xcode7(iOS9 beta1)网络请求失败,配置info.plist文件解决--iOS开发
2016-03-25 21:10
573 查看
Application Transport Security has blocked a cleartext HTTP (http://) resource load
since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
上面的错误提示已经说明了了让你去配置info.plist文件,那就去配置呗,咋整
归根结底还是是苹果吧人家http协议改成了https协议,在iOS9
beta1的时候就改了,使用 TLS1.2 SSL加密请求数据。不知道人家怎么想的,可能认为不安全吧,所以这样做了,英文再怎么不好也能从上面的英文句子可以看到一点的。
就这样:添加一个字典,字典里添加一个BOOl值元素,详情如下:
NSAppTransportSecurity 后面的类型选择(一般默认的就是字典)->Dictionary
子元素NSAllowsArbitraryLoadsBoolean值默认为NO,自己改成YES就好了
好了!
重新运行Application就可以了。
另外,这事苹果官网的说法,谁要有空可以顺便翻一下
App Transport Security
App Transport Security (ATS) enforces best practices in the secure connections between an app and its back end. ATS prevents accidental disclosure, provides secure default behavior, and is easy to adopt; it is also on by default in iOS 9 and OS X v10.11. You
should adopt ATS as soon as possible, regardless of whether you’re creating a new app or updating an existing one.
If you’re developing a new app, you should use HTTPS exclusively. If you have an existing app, you should use HTTPS as much as you can right now, and create a plan for migrating the rest of your app as soon as possible. In addition, your communication through
higher-level APIs needs to be encrypted using TLS version 1.2 with forward secrecy. If you try to make a connection that doesn't follow this requirement, an error is thrown. If your app needs to make a request to an insecure domain, you have to specify this
domain in your app's
since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
上面的错误提示已经说明了了让你去配置info.plist文件,那就去配置呗,咋整
归根结底还是是苹果吧人家http协议改成了https协议,在iOS9
beta1的时候就改了,使用 TLS1.2 SSL加密请求数据。不知道人家怎么想的,可能认为不安全吧,所以这样做了,英文再怎么不好也能从上面的英文句子可以看到一点的。
就这样:添加一个字典,字典里添加一个BOOl值元素,详情如下:
NSAppTransportSecurity 后面的类型选择(一般默认的就是字典)->Dictionary
子元素NSAllowsArbitraryLoadsBoolean值默认为NO,自己改成YES就好了
好了!
重新运行Application就可以了。
另外,这事苹果官网的说法,谁要有空可以顺便翻一下
App Transport Security
App Transport Security (ATS) enforces best practices in the secure connections between an app and its back end. ATS prevents accidental disclosure, provides secure default behavior, and is easy to adopt; it is also on by default in iOS 9 and OS X v10.11. You
should adopt ATS as soon as possible, regardless of whether you’re creating a new app or updating an existing one.
If you’re developing a new app, you should use HTTPS exclusively. If you have an existing app, you should use HTTPS as much as you can right now, and create a plan for migrating the rest of your app as soon as possible. In addition, your communication through
higher-level APIs needs to be encrypted using TLS version 1.2 with forward secrecy. If you try to make a connection that doesn't follow this requirement, an error is thrown. If your app needs to make a request to an insecure domain, you have to specify this
domain in your app's
Info.plistfile.
相关文章推荐
- iOS开发之路--微博“更多”页面
- iOS开发之路--微博骨架搭建
- iOS开发使用JSON解析网络数据
- IOS开发代码分享之获取启动画面图片的string
- iOS开发实现音频播放功能
- iOS开发使用XML解析网络数据
- IOS开发实现录音功能
- IOS开发之路--C语言数组和字符串
- IOS开发代码分享之用nstimer实现倒计时功能
- iOS开发使用GDataXML框架解析网络数据
- IOS开发代码分享之设置UISearchBar的背景颜色
- ios推送证书
- iOS和tvOS游戏按需加载资源简介
- ios开发之环境搭建-01
- 在开发iOS程序时对日期处理的总结
- iOS开发——keychain的使用
- iOS Graphics Technologies iOS 图形技术
- iOS开发异常错误总结
- 学习Objective-C:入门手册