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 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
时间: 2024-08-11 01:25:28

The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.问题解决的相关文章

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

1.xcode7/ios 访问网络报错:The resource could not be loaded because the App Transport Security policy requires the use of a secure connection. 解决方案: iOS9引入了新特性ATS,要求App内的访问网络必须使用HTTPS协议! 2.使用NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:

iOS9 出现 the resource could not be loaded because the app transport security policy requires the use of a secure connection 解决办法

今天更新了Xcode 7 正式版,App编译出现很多警告,在App运行的时候出现如下的提示......... 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 Tra

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>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict> 如图所示: 解决方案之二: a.在Xcode里选中info.

网络请求报错: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文件中加入以下内容即可 如果你想设置只允许特定host的网络请求,在info.plist文件中加入以下内容 这样,你在发往baike.baidu.com这个host的请求就都不会被阻止了,你可以注册多个域名.

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 (ATS)新特性要求App内访问的网络必须使用HTTPS协议.但是现在公司的项目使用的是HTTP协议,使用私有加密方式保证数据安全.现在也不能马上改成HTTPS协议传输. 解决方法: 在Info.plist中添加NSAppTransportSecurity类型Dictionary. 在NSAppTran

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 Security policy requires the use of a secure connection. Google后查证,iOS9引入了新特性App Transport Security (ATS).详情:App Transport Security (ATS) 新特性要求App内访问的网络必须使用H

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 resource could not be loaded because the App Transport Security policy requires the use of a secure connection. 转载自http://blog.csdn.net/feixiang_song

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的解决办法 今天使用Xcode 7打开用Xcode 6开发的网络请求项目,Xcode 7 控制台提示如下: App TransportSecurity has blocked a cleartext HTTP (http://) resource load since it isinsecure. Temporary except

App Transport Security has blocked a cleartext HTTP (http://) resource load

"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" // 报错,按照要求设置了之后,还是报这个错误.(快疯了) 删除了 info.plist 中的配置重新写了一遍,好了(真TMD神奇) 配置: 如果是H