创建密钥库
使用java自带keytool创建本地密钥库
密码:changeit
别名:cas.example.org
keytool -genkey -alias cas.example.org -keyalg RSA -keystore casexample.keystore
把秘钥库导出成证书文件
keytool -export -alias cas.example.org -keystore casexample.keystore -file casexample.crt -storepass changeit
认证证书
jdk 进行认证证书
keytool -import -keystore "E:/RUANJIANANZHUANG/java/jdk1.8.0_212/jre/lib/security/cacerts" -storepass changeit -file casexample.crt -alias cas.example.org
配置tomcat
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true">
<SSLHostConfig>
<Certificate certificateKeystoreFile="D:/ /casexample.keystore" certificateKeystorePassword="changeit" type="RSA"></Certificate>
</SSLHostConfig>
</Connector>