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

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
J
Java Code Geeks
量子位
腾讯CDC
C
Check Point Blog
小众软件
小众软件
IT之家
IT之家
I
InfoQ
Hugging Face - Blog
Hugging Face - Blog
Stack Overflow Blog
Stack Overflow Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
GbyAI
GbyAI
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
博客园_首页
S
SegmentFault 最新的问题
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
Martin Fowler
Martin Fowler

博客园 - silyvin

去中心化的jwt(三)支付安全(三)RFC 6238 离线 更新一个索引中的健 ssl pinning(四)shadowrocket补充说明,SNI路由为什么是反向代理不是正向代理,TLS termination&passthrough【重要】 - silyvin 微服务的同步异步(三)非阻塞redis客户端 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代理服务器(六)再次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