如何配置https

 

1.创建证书:keytool -genkey -alias wsria -keyalg RSA -keystore d:/keys/wsriakey

其中姓氏和组织名称为登录时的域名:如localhost baidu.com sso.wsria.com

2。导出证书:D:\keys>keytool -export -file d:/keys/wsria.crt -alias wsria -keystore d:/keys/wsriakey

3. 为客户端的JVM导入证书,keytool -import -keystore D:\tools\jdk\1.6\jdk1.6.0_20\jre\lib\security\cacerts -file D:/keys/wsria.crt 

4. 应用证书到Web服务器-Tomcat:

connector port="8443" protocol="HTTP/1.1" sslenabled="true" maxthreads="150"

scheme="https" secure="true" clientauth="false" sslprotocol="TLS"
keystorefile="D:/keys/wsriakey" keystorepass="wsria.com">
</connector>
 
  • keystoreFile:在第一步创建的key存放位置
  • keystorePass:创建证书时的密码

访问:https://sso.wsria.com:8443/

 

参考:http://lixor.iteye.com/blog/1532655

posted on 2017-01-22 21:36  卖肾割阑尾  阅读(142)  评论(0编辑  收藏  举报

导航