App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.-解决办法
运行环境:Xcode Version 7.3.1 (7D1014)
使用NSURL进行数据请求数据代码:
-(NSData *)requestData{
NSURL *url = [NSURL URLWithString:@"http://easyread.ph.126.net/seRpubnsz_WwJGz7fexyeg==/7696583593456123398.jpg"];
NSData *data = [NSData dataWithContentsOfURL:url];
return data;
}
报错:
2016-07-04 17:11:44.325 testMultiThread[2904:173072] App 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.
原因:Xcode版本的新特性要求App内访问网络请求,要采用 HTTPS 协议。
但是现在公司的项目使用的是 HTTP 协议,使用私有加密方式保证数据安全。现在也不能马上改成 HTTPS 协议传输。
最终找到以下解决办法:
1、在Info.plist中添加 NSAppTransportSecurity 类型 Dictionary ;
在info.plist中添加
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
2、在 NSAppTransportSecurity 下添加 NSAllowsArbitraryLoads 类型Boolean ,值设为 YES;
运行结果:
App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.-解决办法的更多相关文章
- App 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
ios进行http请求,会出现这个问题: App Transport Security has blocked a cleartext HTTP (http://) resource load sin ...
- iOS使用webView 加载网页,在模拟器中没有问题,而真机却白屏了。App 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 f
还在info.plist中配置.除了配置允许上网的配置之外,还有另一项.
- 无法下载图片 App 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
刚学线程通信,提示: 2016-01-27 11:11:02.246 20-9 gcd3 communicationOfThread[5193:298643] App Transport Securi ...
- App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.
[摘要: App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecur ...
- IOS开发 App 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.
xcode自7后不再使用http,而是使用https请求,但目前很多网络请求还只是以http请求,我们可以这样解决 info.plist->添加@“App Transport Security ...
- iOS App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.
You can easily add it to the plist using the GUI: On the last line add the + Enter the name of the g ...
- 报错: App Transport Security has blocked a cleartext HTTP (http://) resource load since it is ins
环境:Xcode7.1.1 + iOS9.1 详细错误: App Transport Security has blocked a cleartext HTTP (http://) resource ...
- Xcode 7提示App Transport Security has blocked a cleartext HTTP (http://) resource load的解决办法
Xcode 7提示App Transport Security has blocked a cleartext HTTP (http://) resource load的解决办法 今天使用Xcod ...
- Xcode 7中http通信出现如下错误: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.
原因 在iOS9 beta1中,苹果将原http协议改成了https协议,使用 TLS1.2 SSL加密请求数据. 解决方法 编辑 info.plist,加入如下设置: <plist> & ...
随机推荐
- HM NIS Edit 2.0.3 Win32 Error. Code:740.请求的操作需要提升
使用NSIS安装向导,生成脚本后,按F9后,居然提示:HM NIS Edit 2.0.3 Win32 Error. Code:740.请求的操作需要提升 一开始就出错了,还真不顺. 在网上搜索了一下, ...
- Poisson Distribution——泊松分布
老师留个小作业,用EXCEL做不同lambda(np)的泊松分布图,这里分别用EXCEL,Python,MATLAB和R简单画一下. 1. EXCEL 运用EXCEL统计学公式,POISSON,算出各 ...
- PTA作业
- python模块之collections
我们都知道,Python拥有一些内置的数据类型,比如str, int, list, tuple, dict等, collections模块在这些内置数据类型的基础上,提供了几个额外的数据类型: (1) ...
- 回顾Spring框架
Spring框架: 传统JavaEE解决企业级应用问题时的"重量级"架构体系,使它的开发效率,开发难度和实际的性能都令人失望.Spring是以一个 救世主的身份降临在广大的程序员面 ...
- [转]LUA元表
lua元表和元方法 <lua程序设计> 13章 读书笔记 lua中每个值都有一个元表,talble和userdata可以有各自独立的元表,而其它类型的值则共享其类型所属的单一元表.lua在 ...
- Android 学习第11课,android 实现拨打电话的功能
1. 先布局界面,界面采用线性垂直方式来布局 在layout 界面文件中 activity_main.xml 中 <LinearLayout xmlns:android="http:/ ...
- jquery事件重复绑定的快速解决方法
click等事件 解决:使用unbind("click")方法先解除绑定的事件再绑定新事件,即在给对象绑定事件之前先移除该对象上的原有事件 1 $("#test2&quo ...
- 第七课 第二节,T语言流程语句(版本5.0)
while语句 循环结构是程序中一种很重要的结构其特点是,在给定条件成立时,反复执行某程序段,直到条件不成立为止给定的条件称为循环条件,反复执行的程序段称为循环体 (注:关键字,while,end) ...
- video 与 audio
Play方法:使用play方法来播放媒体,自动将元素的paused属性的值变为false.Pause方法:使用pause方法来暂停播放,自动将元素的paused属性的值变为true.Load方法:使用 ...