5fc9f05f1245c3225.jpg_fo742.jpg

1.创建 .keystore 文件

使用如下命令生成 .keystore 文件,然后在相应的框中输入对应内容。

$ JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA

111.png

2.在server.xml中启用SSL HTTP/1.1连接器,端口 8443

修改 /conf/server.xml 文件:

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
            maxThreads="150" scheme="https" secure="true"
            clientAuth="false" sslProtocol="TLS"
            keystoreFile="${user.home}/.keystore"   
            keystorePass="123@com"/>

"keystorePass" 是生成 .keystore 文件的密码。

3.接着重启 Tomcat,打开浏览器访问如下地址:https://localhost:8443

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code