%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA
密匙:xxxxx
生成路径:C:\Users\xxx\.keystore
将.keystore文件复制到tomcat/bin
在conf/server.xml中添加
<!-- duzhw update for https request 20161120 -->
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystoreFile="bin/.keystore" keystorePass="xxxxx" />
然后启动服务浏览器访问
--加密的请求 https的
https://localhost:8443/beiking/index.jsp
--未加密的请求 http的
http://localhost:8090/beiking/index.jsp
--规避web访问http 以及keystorePass="ardopass"加密(opensll)可以参考:
http://blog.sina.com.cn/s/blog_64a52f2a0101g35m.html