Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
来源:互联网 发布:js拉链是哪个国家的 编辑:程序博客网 时间:2024/06/06 22:17
今天升级Xcode 7.0 bata
发现网络访问失败。
输出错误信息
<code style="padding: 0px; color: inherit; white-space: inherit; background-color: transparent;"><span style="font-family:Comic Sans MS;font-size:18px;">The resource could not be loaded because the App Transport Security policy requires the <span class="hljs-operator"><span class="hljs-keyword" style="color: rgb(133, 153, 0);">use</span> <span class="hljs-keyword" style="color: rgb(133, 153, 0);">of</span> a secure <span class="hljs-keyword" style="color: rgb(133, 153, 0);">connection</span>.</span></span></code>
Google后查证,iOS9引入了新特性App Transport Security (ATS)
。详情:App Transport Security (ATS)
新特性要求App内访问的网络必须使用HTTPS
协议。
但是现在公司的项目使用的是HTTP
协议,使用私有加密方式保证数据安全。现在也不能马上改成HTTPS
协议传输。
最终找到以下解决办法:
- 在Info.plist中添加
NSAppTransportSecurity
类型Dictionary
。 - 在
NSAppTransportSecurity
下添加NSAllowsArbitraryLoads
类型Boolean
,值设为YES
参考:
- App Transport Security support aka apps on iOS 9 don't work #4560
- 711_networking_with_nsurlsession.pdf
1 0
- Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- Xcode7 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- Xcode7 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- Xcode7 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- Xcode7 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- Xcode7 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- Xcode7 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- Xcode7 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- Xcode7 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- Xcode7 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- Xcode7 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- Xcode7 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- Xcode7 网络请求报错:The resource could not be loaded because the App Transport Security policy requires th
- 1144数星星
- C++解析字符串中数据
- 读《大型网站技术架构:核心原理与案例分析+李智慧》记一
- Android 网络请求详解
- 【ZYNQ-7000开发之十一】VGA RLT代码封装成AXI Stream
- Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- 利用RunTime实现iOS不同版本下使用不同的图片
- windows10 下面,编译protobuf-java-3.0.0-beta-1.jar
- 【Python】用base64和RC4给数据加密/解密
- JavaSE入门学习18:Java面向对象之多态
- LeetCode22. Generate Parentheses
- 开启Hadoop2.6.0出现ssh无法解析主机名等错误提示的解决办法!
- 有符号数与无符号数
- CNN中各层图像大小的计算