1. 先用如下命令生成tomcat 证书

 cls 

 rem please set the env JAVA_HOME before run this bat file
SET JAVA_HOME=C:\Programs\Java\jdk1..0_51
SET PATH=%PATH%;%JAVA_HOME%/bin rem delete alias tomcat if it is existed
keytool -delete -alias tomcatsso -keystore %JAVA_HOME%/jre/lib/security/cacerts -storepass changeit REM DELETE existing tomcatsso certified book
keytool -delete -alias tomcatsso -storepass changeit rem list all alias in the cacerts
REM List ALL certified in certified warehouse
keytool -list -keystore %JAVA_HOME%/jre/lib/security/cacerts -storepass changeit rem generator a key
REM use RSA algorithm, generate a certified with name=tomcatsso, password=changeit
REM certified DN= cn=locahost, please make sure the DN = the host name
keytool -genkey -keyalg RSA -alias tomcatsso -dname "cn=localhost" -storepass changeit rem export the key
REM expoert the certified from keystore, generate tomcatsso.crt file
keytool -export -alias tomcatsso -file %JAVA_HOME%/jre/lib/security/tomcatsso.crt -storepass changeit REM import into trust cacerts, generate tomcatsso.crt file
REM import the tomcatsso.crt INTO JRE trusted certified warehouse, make sure the jre dir is the same as the jre which used by Tomcat, or Tomcat will not able to find the Certified
keytool -import -alias tomcatsso -file %JAVA_HOME%/jre/lib/security/tomcatsso.crt -keystore %JAVA_HOME%/jre/lib/security/cacerts -storepass changeit rem list all alias in the cacerts
keytool -list -keystore %JAVA_HOME%/jre/lib/security/cacerts -storepass changeit

2.After the script run complete, verify the certificate generated correctly

(1) check there is a tomcatsso.crt in your %JAVA_HOME%\jre\lib\security

(2) check there is a .keystore in your C:\Documents and Settings\YOUR_USERNAME

3.在Eclipse 中的配置tomcat

保证启动tomcat的jdk是刚才用于生成证书的jdk

(2) 编辑Server.XML, 加入keystore和CA 证书

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true"
keystoreFile="C:/Documents and
Settings/e527051/.keystore" keystorePass="changeit"      
truststoreFile="C:/Programs/Java/jdk1.6.0_22/jre/lib/security/cacerts"

clientAuth="false" sslProtocol="TLS" />

(3) 用8443端口打开应用

https://localhost:8443/ewusu-network

https://localhost:8443/ewusu-engine

下一篇文章讲解如何使用jasig cas在Tomcat中设置single sign on

最新文章

  1. Angular版本1.2.4在IE11的IE8模式下出错解决方案
  2. error: RPC failed; result=22, HTTP code = 411
  3. C语言-自定义函数
  4. Edge Linking
  5. 关于css3的动画总结
  6. linux磁盘空间清理
  7. lower power的physical library
  8. Spark机器学习 Day2 快速理解机器学习
  9. WinForm TextBox自定义扩展方法数据验证
  10. 快速批量插入sqlserver方法之我见
  11. HTTP学习(一)初识HTTP
  12. 翻译:JVM虚拟机规范1.7中的运行时常量池部分(一)
  13. Layout-2相关代码:3列布局代码演化[一]
  14. Win10升级.NET Framework 3.5或2.0遇到错误0x800f081f怎么办
  15. vmware 12 可用 序列号
  16. 【Go命令教程】13. go tool cgo
  17. 采用get方式提交数据到服务器实例
  18. STM32的操作过程,寄存器配置与调试过程(转载)
  19. Oracle数据库PL/SQL Developer查询结果显示问号乱码的解决方法
  20. 联想G480安装固态硬盘过程

热门文章

  1. C# socket 实现消息中心向消息平台 转发消息 (修改)
  2. 初始twisted(一)
  3. iOS 中使用md5加密
  4. svn merge和branch
  5. maven属性
  6. 水王ID查找
  7. C#基础——三元表达式
  8. 【BZOJ】【2705】【SDOI2012】Longge的问题
  9. Rich Text Editor for MVC
  10. 为了让vi命令也可以使用vim的配置,需要修改 vi /etc/bashrc 增加一行 alias vi=&#39;vim&#39;此时,经过上面配置已经可以显示语法高亮了