tomcat设置https
1.环境
tomcat8.5.9
2.JKS 证书格式配置方法1
"8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" keystoreFile="C:\Users\peng\Downloads\cert.jks" keyAlias="gw" keystorePass="123456" clientAuth="false" sslProtocol="TLS" />
keyAlias 一定要写,不然会有空指针异常
JKS 证书格式配置方法2
"8443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true" > <Certificate certificateKeystoreFile="C:\Users\peng\Downloads\cert.jks" certificateKeyAlias="gw" certificateKeystorePassword="123456" type="RSA" />
certificateKeyAlias一定要写,不然会有空指针异常
3.PEM(KEY&CRT)证书格式配置方法
"8443" protocol="org.apache.coyote.http11.Http11AprProtocol" maxThreads="150" SSLEnabled="true" > "org.apache.coyote.http2.Http2Protocol" /> "F:\key.txt" certificateFile="F:\cert.cer" type="RSA" />
证书格式转换工具:https://ssl.cfca.com.cn/Web/tool