jdk生成keys(用于配置https)

来源:互联网 发布:远东水利造价软件 编辑:程序博客网 时间:2024/06/08 10:44

%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


原创粉丝点击