【iOS】App Transport Security
iOS9中新增App Transport Security(简称ATS)特性, 主要使到原来请求的时候用到的HTTP,都转向TLS1.2协议进行传输。这也意味着所有的HTTP协议都强制使用了HTTPS协议进行传输。
错误信息如下:
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.
解决方法:
1. 在 Filter 中搜索 Info.plist,选择 Info.plist 进行编辑,如图所示:
2. 按照上面提到的方式添加信息,正确的修改会看到下图这个样子,注意类型 NSAppTransportSecurity 为 Dictionary,NSAllowsArbitraryLoads 为 Boolean, 如下所示:
3. 注意⚠️,单元测试下面也有一个Info.plist,修改那个文件是没有作用的!
PS: 刚开始添加后可能会没效果,后来又删除重试了几次才行。
参考:
https://segmentfault.com/a/1190000002933776
http://my.oschina.net/vimfung/blog/494687
【iOS】App Transport Security的更多相关文章
- 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的生命周期
对于iOS应用程序,关键的是要知道你的应用程序是否正在前台或后台运行.由于系统资源在iOS设备上较为有限,一个应用程序必须在后台与前台有不同的行为.操作系统也会限制你的应用程序在后台的运行,以提高电池 ...
- iOS App 不支持http协议 App Transport Security has blocked a cleartext HTTP (http://)
目前iOS已经不支持http协议了,不过可以通过info.plist设置允许 App Transport Security has blocked a cleartext HTTP (http://) ...
- iOS: iOS9 beta 请求出现App Transport Security has blocked a cleartext HTTP (http://)
错误描述: App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecu ...
- 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中配置.除了配置允许上网的配置之外,还有另一项.
- 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 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】在Swift中使用JSONModel
前言 首先所有的Model还是使用oc来写——看到这一句是不是想关网页了- - #,在swift里面直接写一直报错所以就将就用oc来写了,这里主要是分享一下搭配Alamofire使用的经验. 声明 欢 ...
- App Transport Security has blocked a cleartext HTTP (http://)
使用SDWebImage加载“http://”开头的图片报错,错误如下: App Transport Security has blocked a cleartext HTTP (http://) r ...
随机推荐
- Django之Cookie Session详解,CBV,FBV登陆验证装饰器和自定义分页
Cookie Session和自定义分页 cookie Cookie的由来 大家都知道HTTP协议是无状态的. 无状态的意思是每次请求都是独立的,它的执行情况和结果与前面的请求和之后的请求都无直接 ...
- mpvue 试水的一天
小程序经过了将近两年的锤炼,现在出现了许许多多的框架,来帮助我们进行快速开发,最近可能迷上了mpvue这个框架,所以就用公司的项目练练手. mpvue是用vue作为基础骨架的,所以他非常想vue,所以 ...
- Hadoop 学习之路(三)—— 分布式计算框架 MapReduce
一.MapReduce概述 Hadoop MapReduce是一个分布式计算框架,用于编写批处理应用程序.编写好的程序可以提交到Hadoop集群上用于并行处理大规模的数据集. MapReduce作业通 ...
- SSM(三)Mybatis动态SQL
1.查询语句,where: <resultMap id="xxx" type="xx..Student" autoMapping="false& ...
- 设计模式-状态模式(State)
状态模式是行为模式的一种,状态模式允许改变对象内部状态来改变对象的行为. 角色和职责: 1.上下文(Context)-Order: 拥有内部的状态 2.状态接口(Status)-State: 一 ...
- Connecting to the Network
This lesson shows you how to implement a simple application that connects to the network. It explain ...
- dockerfile 制作镜像
# Set the base image to UbuntuFROM ubuntu # File Author chenghanMAINTAINER chenghan ################ ...
- svg文字描边动画
svg动画在网页中是经常见到的,svg动画使得网页看起来清新美观 任何不规则图形都可以由svg绘制完成,当然也包括文字,文字本身就可以看作一个不规则图形
- java高并发系列 - 第16天:JUC中等待多线程完成的工具类CountDownLatch,必备技能
这是java高并发系列第16篇文章. 本篇内容 介绍CountDownLatch及使用场景 提供几个示例介绍CountDownLatch的使用 手写一个并行处理任务的工具类 假如有这样一个需求,当我们 ...
- SpringBoot解决cors跨域问题
1.使用@CrossOrigin注解实现 (1).对单个接口配置CORS @CrossOrigin(origins = {"*"}) @PostMapping("/hel ...