Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
来源:互联网 发布:域名重定向设置 编辑:程序博客网 时间:2024/06/06 02:15
今天升级Xcode 7.0 bata
发现网络访问失败。
输出错误信息
The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
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
0 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
- 51nod1189
- 十大滤波算法程序大全
- Android设计模式系列--工厂方法模式
- windows 查找端口占用程序
- 工厂模式的解读与思考
- Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Security policy requir
- hdoj 2111 Saving HDU
- 深入浅出Mybatis-与Spring集成
- ios 为图片加上水印详解
- 字符串的比较
- 基本排序方法之五——简单选择排序
- CSS基础-21CSS定位-浮动的应用,实现瀑布流布局
- Android基础之intent传值的三种方法
- CodeForces_435B_C