Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport

Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

原来代码中的UIWebView网络请求均报错.

今天升级Xcode 7.0 bata发现网络访问失败。

didFailLoadWithError():

Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection." UserInfo={NSUnderlyingError=0x7fce0c9ac400 {Error Domain=kCFErrorDomainCFNetwork Code=-1022 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection." UserInfo={NSErrorFailingURLStringKey=http://www.baidu.com/, NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection., NSErrorFailingURLKey=http://www.baidu.com/}}, NSErrorFailingURLStringKey=http://www.baidu.com/, NSErrorFailingURLKey=http://www.baidu.com/, NSLocalizedDescription=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协议传输。

最终找到以下解决办法:

  1. 在Info.plist中添加NSAppTransportSecurity类型Dictionary
  2. NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES

Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.的更多相关文章

  1. IOS9网络请求报错:The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

    今天下载Xcode7试了下,运行项目时报上面的错误,网上查了下原来iOS9引入了新特性App Transport Security (ATS).详情:App Transport Security (A ...

  2. The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.问题解决

    didFailLoadWithError(): Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loa ...

  3. 网络请求报错:The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

    iOS9引入了新特性App Transport Security (ATS).详情:App Transport Security (ATS) 如果你想设置不阻止任何网络,只需要在info.plist文 ...

  4. xcode9.4 报错 error:The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

    原因 http | https 协议  不能正常使用 找到的解决方案 但是在字段名上有了变化,不过复制进去 还是会自动选择对应的 解决办法 1. 在Info.plist中添加 App Transpor ...

  5. The resource could not be loaded because the App Transport Security policy requires the use of a secure connection

    xmpp 项目中遇到的问题,用苹果的通信API 写一个PUT 方法,向服务器上传一张图片.遇到如题问题. Plist 文件没有NSAppTransportSecurity属性 Dic,添加该属性,再添 ...

  6. AFNetworking 提示"The resource could not be loaded because the App Transport Security policy requires the use of a secure connection" 解决办法

    原因:iOS9以后,苹果把原http协议改成了https协议,所以不能直接在http协议下GET/POST 解决方案之一: 直接编辑工程文件下的Info.plist文件,加入以下代码 <key& ...

  7. Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport

    Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Xcode7 beta 网络请求报错:The ...

  8. Xcode7 beta 网络请求报错:The resource could not be loaded because the App Transport Security policy requir

          今天升级Xcode 7.0 bata发现网络访问失败.输出错误信息 The resource could not be loaded because the App Transport S ...

  9. 网络请求出错:The resource could not be loaded because the App Transport

    Google后查证,iOS9引入了新特性App Transport Security (ATS).详情:App Transport Security (ATS) 新特性要求App内访问的网络必须使用H ...

随机推荐

  1. activity的android:name 设置问题

    <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com. ...

  2. 如何利用jq来实现复选框的全选,反选!

    $("document").ready(function(){ $("#btn1").click(function(){ $("[name='chec ...

  3. JS常用的设计模式(15)—— 职责链模式

    职责链模式是一个对象A向另一个对象B发起请求,如果B不处理,可以把请求转给C,如果C不处理,又可以把请求转给D.一直到有一个对象愿意处理这个请求为止. 打个比方,客户让老板写个php程序.老板肯定不写 ...

  4. Java 并发编程实战 摘要

    第一部分小结 并发技巧清单: 可变状态是至关重要的(It's the mutable state ,stupid). 所有的并发问题结为如何协调对并发状态的访问,可变状态越少,就越容易确保线程安全性. ...

  5. Linux下切换用户

    0x01 使用命令[su username] 这种方法能切换普通用户和root用户 0x02 从普通用户切换到root用户,还可以使用命令[sudo su] 0x03 su 是switch user的 ...

  6. php mkdir函数

    if(!is_dir($targetPath)){mkdir($targetPath, 0700); } is_dir 判断目录是否存在 mkdir 不能创建多级目录

  7. C\C++ 框架和库整理(转)

    [本文系外部转贴,原文地址:http://coolshell.info/c/c++/2014/12/13/c-open-project.htm]留作存档 下次造轮子前先看看现有的轮子吧 值得学习的C语 ...

  8. 最新仿梦芭莎免费ecshop模板

    最新仿梦芭莎免费ecshop模板,该源码很真实地模仿了我们比较熟悉的梦芭莎购物网站的,我们知道该网站商城很受大家的喜欢的,而且界面也很漂亮的,希望能够帮到大家的学习. <ignore_js_op ...

  9. c++强制类型转换(static_cast,const_cast,dynamic_cast,reinterpret_cast)

    static_cast <typeid>(exdlvssion) static_cast 很像 C 语言中的旧式类型转换.它能进行基础类型之间的转换,也能将带有可被单参调用的构造函数或用户 ...

  10. sqoop导出工具

    sqoop的导出工具是把HDFS上文件中的数据导出到mysql中 mysql中的表 现在在linux上创建一个文件,并把这个文件上传到hdfs上 cat person.txt ,no7, ,no8, ...