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

推荐订阅源

P
Privacy International News Feed
WordPress大学
WordPress大学
Security Latest
Security Latest
Cyberwarzone
Cyberwarzone
K
Kaspersky official blog
Cisco Talos Blog
Cisco Talos Blog
Microsoft Security Blog
Microsoft Security Blog
G
GRAHAM CLULEY
N
News | PayPal Newsroom
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog
美团技术团队
J
Java Code Geeks
I
Intezer
The Cloudflare Blog
SecWiki News
SecWiki News
S
Secure Thoughts
Microsoft Azure Blog
Microsoft Azure Blog
V2EX - 技术
V2EX - 技术
C
Cyber Attacks, Cyber Crime and Cyber Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Spread Privacy
Spread Privacy
D
DataBreaches.Net
S
Security Affairs
Help Net Security
Help Net Security
S
Securelist
F
Full Disclosure
C
Check Point Blog
F
Fortinet All Blogs
Know Your Adversary
Know Your Adversary
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
阮一峰的网络日志
阮一峰的网络日志
The Register - Security
The Register - Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
人人都是产品经理
人人都是产品经理
博客园_首页
G
Google Developers Blog
Google Online Security Blog
Google Online Security Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Help Net Security
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
Application and Cybersecurity Blog
Application and Cybersecurity Blog
H
Hacker News: Front Page
L
LINUX DO - 热门话题
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LangChain Blog

博客园 - silyvin

nat在第几层(二)出站流量需要nat? tomcat白名单(十)passthrough配合SNI究竟在第几层【重要】 sock5代理及隧道(三)dns用谁的【yetdone】 一个字符串可以是什么 微服务的同步异步(二)一个线程多个请求与一个连接多个请求(http2),客户端的多路复用 吞吐量、线程数、队列(好像没什么用) 去中心化的jwt(二)HS256、RS256、分级 什么叫无状态 直接进老年代的大对象指的是shallow还是retained 如何定义强一致和MVCC 三方支付为什么不用双向ssl,与U盾 事务消息与本地消息表的联系 再谈线程池或连接池容量怎么定 【删除】微信支付的收单机构 【删除】TLS前向保密 缓存一致性的根本原因 ssl pinning clienthello会不会拆粘包,为什么每次wireshark看到的都是正好的 转账tcc 安全采集jvm https代理服务器(八)安卓7 https代理服务器(七)假如被CA出卖 spi 微服务的同步异步【重要】 为什么tcp要用mss oauth为什么要传输secret https代理服务器(五)换电脑 多线程插入也是随机io,那为啥不用uuid【yetdone】 http长连接维护 【yet】
https代理服务器(六)再次java动态签发【成功】
silyvin · 2025-10-28 · via 博客园 - silyvin

1

X500Name canamem = new X500Name(caCertificate.getSubjectX500Principal().getName());

改为

X500Name issuerName = new JcaX509CertificateHolder(caCertificate).getSubject();

否则写入keystore时报错 KeyStoreException: Certificate chain is not valid

2

GeneralNames generalNames = new GeneralNames(
new GeneralName[]{new GeneralName(GeneralName.dNSName, subject),
new GeneralName(GeneralName.dNSName, "hhh.com")}
);
certificateBuilder.addExtension(
org.bouncycastle.asn1.x509.Extension.subjectAlternativeName,
false,
generalNames
);

必须,iphone实测

3

System.setProperty("javax.net.ssl.trustStore", "rootCA.pem");

这一句不能加

/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home!/java.base/sun/security/ssl/TrustStoreManager.class

static {
fileSep = File.separator;
defaultStorePath = GetPropertyAction.privilegedGetProperty("java.home") + fileSep + "lib" + fileSep + "security";
defaultStore = defaultStorePath + fileSep + "cacerts";
jsseDefaultStore = defaultStorePath + fileSep + "jssecacerts";
}

sun.security.ssl.TrustStoreManager.TrustStoreDescriptor#createInstance

String storePropName = System.getProperty("javax.net.ssl.trustStore", TrustStoreManager.TrustStoreDescriptor.jsseDefaultStore);

 否则好像这个地方报错,不记得了

public static SSLContext getSslContextSuper(String host) throws Exception {
SSLContext sslContext = SSLContext.getInstance("TLSv1");
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
KeyStore ks = CertificateGenerator.genkeyStore(host);
char[] passArray = "changeit".toCharArray();
kmf.init(ks, passArray);
sslContext.init(kmf.getKeyManagers(), null, null);
return sslContext;
}

image

new Date(System.currentTimeMillis() - 60000),  

服务器证书starttime给扰动,否则iphone和mac时间不一样或者传输太快iphone会判定证书过期

5 碎碎念

image