惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Spread Privacy
Spread Privacy
L
LangChain Blog
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
人人都是产品经理
人人都是产品经理
H
Hackread – Cybersecurity News, Data Breaches, AI and More
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Engineering at Meta
Engineering at Meta
P
Privacy International News Feed
I
Intezer
NISL@THU
NISL@THU
Jina AI
Jina AI
G
GRAHAM CLULEY
C
CERT Recently Published Vulnerability Notes
S
Schneier on Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cisco Talos Blog
Cisco Talos Blog
Scott Helme
Scott Helme
MyScale Blog
MyScale Blog
IT之家
IT之家
Security Latest
Security Latest
C
Cisco Blogs
Cyberwarzone
Cyberwarzone
aimingoo的专栏
aimingoo的专栏
V
Vulnerabilities – Threatpost
L
LINUX DO - 热门话题
Recorded Future
Recorded Future
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
月光博客
月光博客
A
Arctic Wolf
云风的 BLOG
云风的 BLOG
N
Netflix TechBlog - Medium
K
Kaspersky official blog
S
Securelist
M
MIT News - Artificial intelligence
T
Threat Research - Cisco Blogs
P
Palo Alto Networks Blog
Simon Willison's Weblog
Simon Willison's Weblog
Know Your Adversary
Know Your Adversary
WordPress大学
WordPress大学
Project Zero
Project Zero
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
News and Events Feed by Topic
AWS News Blog
AWS News Blog
T
The Exploit Database - CXSecurity.com
T
The Blog of Author Tim Ferriss

Oragekk's Blog

OpenSpec 技术分享:用规格驱动 AI 编程 ChatGPT&Codex订阅教程 一个 waline 评论系统bug引发的思考 Jenkins 远程触发构建踩坑记 Git SSH 密钥配置 初识Rust vuepress-plugin-meting2 谷歌发布多平台应用开发神器Project IDX!PaLM 2加持 Vue常见优化手段 Vue2响应式原理解析 Dart 中的并发 Flutter 工作原理 如何利用GitHub Action提交URL到搜索引擎 提交URL到搜索引擎(百度、Bing、Google) GitHub Actions 使用介绍 素材设计 前端-Q&A 浏览器的事件循环 你不知道的 CSS 之包含块 CSS 属性计算过程 Vercel deploy忽略指定分支 评论插件 Waline 之邮件通知配置 公开API 终端究极美化iTerm2+Pure 使用Bing API提交网站URL Flutter 基础大集合 关于本站 关于本站 关于我 Markdown 展示 使用n命令管理node版本 幻灯片页 ReactNative State(状态) ReactNative开发环境配置,ES6语法介绍 ReactNative介绍 更优雅强大的终端ZSH 神经网络模型训练 YYCache优秀的缓存设计 WebViewJavascriptBridge NSError WCDB漫谈 优雅的实现TableViewCell单选 初探机器学习框架CoreML 深入理解swift中闭包的捕捉语义 ijkPlayer 集成 iOS timelineLogistics iOS Cookie的配置及使用 WKWebView拦截URL WKWebView使用及自适应高度 textfield限制输入字符 评论系统从多说迁移到disqus指南 利用Runtime进行快速归档 iOS 10.3 keychain 重大更新 Cell的accessoryType属性标记单元格之后,出现的重用问题 通过UserAgent判断设备 AFNetworking A memory leak 一人一句宋词 OC 中的枚举类型 iOS - Image compression algorithm iOS程序启动原理(下) iOS程序启动原理(上) NSOperatioin TableView性能优化 Runloop Test Three ways to call Update Cocoapods 1.1.1 减小iOS-App或者静态库体积 Jekyll旧站回忆 JavaScript ES6 CommonJS,RequireJS,SeaJS 归纳笔记 Unix/Linux 扫盲笔记
iOS 配置https
Oragekk · 2017-08-16 · via Oragekk's Blog

昨天试验了 iOS 11 beta6 发现原有的 https 自建证书不能使用,可能是新版本要对 ATS 加强验证,之前一直说的要全面 https 估计在不久的将来就要来临,未接入的可能要像 Apple 说的不允许上架。所以把配置过程记录在此

要求

启用 ATS 必须符合以下标准,不满足条件的 HTTPS 证书,ATS 都会拒绝链接:

  • 服务器所有的链接使用 TLS1.2 以上版本
  • HTTPS 证书必须使用 SHA 256 以上哈希算法签名
  • HTTPS 证书必须使用 RAS 2048 位或 ECC 356 位以上公钥算法
  • 使用前向加密技术

AFSecurityPolicy 相关的配置

  • SSLPinningMode
    SSLPinningMode 定义了 https 连接时,如何校验服务器端给予的证书

    typedef NS_ENUM(NSUInteger, AFSSLPinningMode){
    AFSSLPinningModeNone,
    AFSSLPinningModePublicKey,
    AFSSLPinningModeCertificate,
    };

    AFSSLPinningModeNone: 代表客户端无条件地信任服务器端返回的证书。

    AFSSLPinningModePublicKey: 代表客户端会将服务器端返回的证书与本地保存的证书中,PublicKey 的部分进行校验;如果正确,才继续进行。

    AFSSLPinningModeCertificate: 代表客户端会将服务器端返回的证书和本地保存的证书中的所有内容,包括 PublicKey 和证书部分,全部进行校验;如果正确,才继续进行。

  • allowInvalidCertificates 是否支持自建证书默认 NO 改为 YES

  • validatesDomainName 是否进行域名验证 默认 YES 改为 NO

客户端配置

  • 首先导入证书到项目
    daoru.md.png
    phases.md.png

  • 配置 info.plist 文件
    infoplist.md.png

  • 网络请求配置(AFN)

NSString *cerPath = [[NSBundle mainBundle] pathForResource:@"UpopRsaCert" ofType:@"cer"];//证书的路径
NSData *certData = [NSData dataWithContentsOfFile:cerPath];
NSString *cerPath2 = [[NSBundle mainBundle] pathForResource:@"verify_sign_acp" ofType:@"cer"];//证书的路径
NSData *certData2 = [NSData dataWithContentsOfFile:cerPath2];
NSString *cerPath3 = [[NSBundle mainBundle] pathForResource:@"myWebsite" ofType:@"cer"];//证书的路径
NSData *certData3 = [NSData dataWithContentsOfFile:cerPath3];
NSSet *cerArray = [NSSet setWithObjects:certData,certData2,certData3, nil];
securityPolicy.pinnedCertificates = cerArray;
[httpManager setSecurityPolicy:securityPolicy];