XCODE7以后不能使用HTTP协议解决办法
来源:互联网 发布:rrt算法原理 编辑:程序博客网 时间:2024/05/29 08:36
在Xcode7.0及以上版本中编译iOS APP时,默认会使用iOS9的一项新特性,使得所有http连接被禁用,项目里使用的API没有https支持,就悲剧了。差了官方文档,有这么一段话
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.plist file.
在这里面可以看到,通过修改Info.plist文件可以继续使用http连接,具体的方法如下:
1.在项目左侧找到Info.plist文件,可以通过Filter来搜索
2.在右侧点击Add Row添加NSAppTransportSecurity,类型为Dictionary,然后再添加子项目NSAllowsArbitraryLoads类行为Boolean值为YES
- XCODE7以后不能使用HTTP协议解决办法
- iOS9与XCode7中不能使用http连接的解决办法
- Xcode7 不能使用http网络请求
- Xcode7 HTTP不能正常使用的方法
- ios9.0之后不能使用Http协议解决办法
- Xcode7中HTTP不能正常请求的解决办法
- [iOS开发]日常需求一:Xcode7、iOS9设置Http网络请求(不能使用Http的解决办法)
- 升级Xcode7之后安装的插件不能使用的解决办法
- HTTP协议在Xcode7.0无法正常使用的问题
- iOS开发,Xcode7升级以后插件无法使用及其不小心点击Skipbundle解决办法
- 12. Xcode7 使用http
- xcode6.4升级以后Alcatraz不能使用的解决办法
- 关于Xcode7上传时出现error的解决办法(Http://)传输协议
- Xcode 7以后在使用HTTP时报错解决办法
- iOS9 HTTP 不能正常使用的解决办法
- iOS9 HTTP 不能正常使用的解决办法
- iOS9 HTTP 不能正常使用的解决办法
- iOS9 HTTP 不能正常使用的解决办法
- 学习mycat过程回顾
- 06-图2 Saving James Bond - Easy Version (25分)
- Java基本语法和命名规范
- QT + vs 运行的项目出现控制台的解决办法
- windows下安装SVN服务器端和客户端和MyEclipse支持
- XCODE7以后不能使用HTTP协议解决办法
- Intellij IDEA15:建立Scala的Maven项目
- 【笔试/面试】—— 从余弦定理到三角形两边之和大于第三边的证明
- Spring初探----Bean的装配
- LeetCode——042
- NYOJ-54小明的存钱计划
- IOS编程info.list文件参数作用
- hdu 2037 今年暑假不AC
- 欢迎使用CSDN-markdown编辑器