JDK1.8 tomcat8支持https

tomcat8支持https


一 生成keystore

cmd运行以下命令:
keytool -genkeypair -alias tomcat -keyalg RSA -keypass changeit -storepass changeit -keystore D:/tomcat.keystore

二 导出证书

keytool -export -file E:/castomcat8/cassso.crt -alias tomcat -keystore E:/castomcat8/tomcat.keystore

三 导入到JDK中

keytool -import -keystore C:\jdk\jre\lib\security\cacerts -file E:/castomcat8/cassso.crt -alias tomcat

四  配置server.xml

    server.xml 添加keystoreFille、keyStorePass
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" 
                keystoreFile="E:\tomcat8\tomcat.keystore" keystorePass="changeit"/>

五 测试https

https://localhost:8443/


猜你喜欢

转载自blog.csdn.net/gamezouni/article/details/78434512