tomcat配置https协议

发布时间 2023-11-27 14:43:36作者: 黑水滴
1、在jdk的安装目录\bin\keytool.exe下打开keytool.exe
进入控制台执行
keytool -genkeypair -alias "tomcat" -keyalg "RSA" -keystore "/opt/tomcat.keystore"
注意:“名字与姓氏”应该是域名,输成了姓名,和真正运行的时候域名不符,会出问题
组织单位写report.test.yunshanmeicai.com,完了后会在/opt/tomcat.keystore生成一个文件
 
 
2、定位到tomcat服务器的安装目录, 找到conf下的server.xml文件
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="/opt/tomcat/apache-tomcat-8.0.47/tomcat.keystore"
keystorePass="123456" />
 
在浏览器输入:https://report.test.yunshanmeicai.com:8443