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的更多相关文章

  1. 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 ...

  2. 【iOS】app的生命周期

    对于iOS应用程序,关键的是要知道你的应用程序是否正在前台或后台运行.由于系统资源在iOS设备上较为有限,一个应用程序必须在后台与前台有不同的行为.操作系统也会限制你的应用程序在后台的运行,以提高电池 ...

  3. 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://) ...

  4. 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 ...

  5. 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中配置.除了配置允许上网的配置之外,还有另一项.

  6. 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 ...

  7. 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 ...

  8. 【iOS】在Swift中使用JSONModel

    前言 首先所有的Model还是使用oc来写——看到这一句是不是想关网页了- - #,在swift里面直接写一直报错所以就将就用oc来写了,这里主要是分享一下搭配Alamofire使用的经验. 声明 欢 ...

  9. App Transport Security has blocked a cleartext HTTP (http://)

    使用SDWebImage加载“http://”开头的图片报错,错误如下: App Transport Security has blocked a cleartext HTTP (http://) r ...

随机推荐

  1. JCS学习记录 --Java Caching System

    Java Caching System--JCS 缓存工具 //jcs版本 jcs-1.3.jar //jcs--cache.ccf缓存配置文件 cache.ccf //所依赖的jar包concurr ...

  2. scikit-learn杂记

    1.数据预处理 二值化 import numpy as np from sklearn import preprocessing X = np.array([[1., -1., 2.], [2., 0 ...

  3. spring 5.x 系列第13篇 —— 整合RabbitMQ (xml配置方式)

    源码Gitub地址:https://github.com/heibaiying/spring-samples-for-all 一.说明 1.1 项目结构说明 本用例关于rabbitmq的整合提供简单消 ...

  4. 【前端工具】页面加载获取url param

    例如跳转进入一个页面: https://mp.csdn.net/postedit/74766644?name=catalina&flag=1 函数: function getParam(par ...

  5. shell写的俄罗斯方块

    共享一下. #!/bin/bash # Tetris Game # xhchen<[email]xhchen@winbond.com.tw[/email]> #APP declaratio ...

  6. c#基础四

    写入一个XML文件 using System; using System.Collections.Generic; using System.Linq; using System.Text; usin ...

  7. Java基础介绍运行机制笔记

    1. 基础知识点图解 编程语言核心结构:变量.基本语法.分支.循环.数组.…… Java面向对象的核心逻辑:OOP.封装.继承.多态.接口…… 开发Java SE高级应用程序:异常.集合.I/O.多线 ...

  8. mysql-8.0.16-winx64/Linux修改root用户密码

    连接数据库等基础操作请自行解决哈,本篇是重点记录如何改密码. 一.查询用户密码: 查询用户密码命令: select host, user, authentication_string from mys ...

  9. 常用的方法论-SMART

  10. linuxprobe培训第2节课笔记2019年7月6日

    使用VM虚拟机配置RHEL实验环境. 鉴于在笔记本上装过centos7,这章内容难度对我来说不是很大. 重置root管理员密码(RHCSA考题,第一题,做不出来无法进行下一步考试) e linux16 ...