https

https

Tomcat

pem 证书转为 Tomcat 所用的 PKCS12 格式(需要设置密码)。 privkey.pem, cert.pem 和 chain.pem 是 Let's Encrpyt 生成的证书文件名。

openssl pkcs12 -export -out bundle.pfx -inkey privkey.pem -in cert.pem -certfile chain.pem -password pass:123456

server.xml 配置

<Connector
           protocol="org.apache.coyote.http11.Http11NioProtocol"
           port="443" maxThreads="200"
           scheme="https" secure="true" SSLEnabled="true"
           keystoreFile="/path/to/bundle.pfx" keystorePass="123456"
           clientAuth="false" sslProtocol="TLS" keystoreType="PKCS12"/>

ECH

测试浏览器是否支持 ECH 等

Chrome 默认支持并启用 ECH ( chrome://flags/#encrypted-client-hello ) : When enabled, Chrome will enable Encrypted ClientHello support. This will encrypt TLS ClientHello if the server enables the extension via the HTTPS DNS record. – Mac, Windows, Linux, ChromeOS, Android, Fuchsia, Lacros (Default == Enabled)

但如果 Windows 系统或 Chrome 里配置了代理,则 ECH 不会生效。这是由 ECH 的原理决定的。使用代理时,域名由代理服务器远端解析。而 ECH 依赖本地 DNS 解析域名的 HTTPS 记录。


Last update: 2023-10-16 03:22:46 UTC