当前位置: 代码迷 >> 综合 >> window 系统,tomcat https SSL配置,
  详细解决方案

window 系统,tomcat https SSL配置,

热度:49   发布时间:2023-10-17 20:05:35.0

1,进入jdk 目录生成keystore

cmd进入 jdk bin 目录下

 

我的是E:\Program Files\Java\jdk1.8.0_131\bin

输入命令

 

 

keytool -genkey -alias tomcat -keyalg RSA  -keystore "E:\Program Files\Java\jdk1.8.0_131\bin\test.keystore"

 

 

改操作完成后,会在该目录下生成test.keystore文件,

 

 

2复制test.keystore复制到tomcat /bin目录下

3修改conf/server.xml ,

注释

 

增加

<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"

maxThreads="150" scheme="https" secure="true"

keystoreFile="bin/test.keystore" keystorePass="111111"

clientAuth="false" sslProtocol="TLS" />

 

 

 

注意:密码要与之前设置的一致

 

 

4启动tomcat

进入tomcat/bin目录启动tomcat

 

 

5修改host

进入C:\Windows\System32\drivers\etc,编辑hosts,在最后增加一行

127.0.0.1       localhost

 

 

 

 

6打开网页

 

 

 

  相关解决方案