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

Tomcat SSL 设置的更多相关文章

  1. 运行两个以上tomcat的设置及内存设置

    运行两个或以上tomcat的设置方法 1.解决端口冲突问题设置方法很简单,修改conf/server.xml配置文件中的3个端口即可.默认端口:8005.8080.8009.一般情况位置如下:**** ...

  2. keytool生成证书与Tomcat SSL配置

    转自:http://tomhat.iteye.com/blog/2087673 一.Keytool介绍 Keytool是一个Java数据证书的管理工具.Keytool将密钥(key)和证书(certi ...

  3. SSL 通信原理及Tomcat SSL 配置

    SSL 通信原理及Tomcat SSL 双向配置 目录1 参考资料 .................................................................. ...

  4. SSL 通信原理及Tomcat SSL 双向配置

    SSL 通信原理及Tomcat SSL 双向配置 目录1 参考资料 .................................................................. ...

  5. ubuntu下apache2 安装 配置 卸载 CGI设置 SSL设置

    一.安装.卸载apache2      apache2可直接用命令安装           sudo apt-get install apache2      卸载比较麻烦,必须卸干净,否则会影响ap ...

  6. Navicat(连接) -1之SSL 设置

    SSL 设置 Secure Sockets Layer(SSL) 是一个通过网际网路传输私人文件的协定.为了安全连接,首先你需要做的是安装 OpenSSL 库和下载数据库源. 注意: 只限于 MySQ ...

  7. Tomcat内存设置详解

    Java内存溢出详解 一.常见的Java内存溢出有以下三种: 1. java.lang.OutOfMemoryError: Java heap space ----JVM Heap(堆)溢出 JVM在 ...

  8. (转)Tomcat内存设置

    Java内存溢出详解 一.常见的Java内存溢出有以下三种: 1. java.lang.OutOfMemoryError: Java heap space ----JVM Heap(堆)溢出 JVM在 ...

  9. 在Apache Tomcat 7设置redis作为session store

    在Apache Tomcat 7设置redis作为session store  //输出tomcat控制台日志 root@ubuntu:~# cd /usr/tomcat/apache-tomcat- ...

随机推荐

  1. iOS 初级数据持久化

    数据持久化 什么是数据持久化? 数据的永久存储 为什么要做数据持久化::存储在内存中的数据,程序关闭,内存释放,数据丢失,这种数据是临时的 数据持久化的本质:数据保存成文件,存储到程序的沙盒中 一.沙 ...

  2. IOS内存管理「1」- 引用计数

  3. C#泛型集合之Dictionary<k, v>使用技巧

    1.要使用Dictionary集合,需要导入C#泛型命名空间 System.Collections.Generic(程序集:mscorlib) 2.描述 1).从一组键(Key)到一组值(Value) ...

  4. pb datawindow 判断是否是最后一列最后一行

    li_column1 = GetColumn() ls_columnname = GetColumnName() Send(Handle(This),,,Long(,)) ll_row2 = GetR ...

  5. JAVA素数分解

    package test; import java.util.*; public class test1 { public static void main(String[] args){ long ...

  6. 用MSBuild和Jenkins搭建持续集成环境(2)

    http://www.infoq.com/cn/articles/MSBuild-2   作者 Mustafa Saeed Haji Ali ,译者 李剑 发布于 2012年10月23日 | 注意:  ...

  7. Android -- 分享功能和打开指定程序

    打开指定程序                                                                                Intent intent ...

  8. vi中正则表达式的使用

    在当前行中删除从aa到zz的所有字符 :s/aa.*zz//在整个文件用and代替所有的&字符:1,$s/&/and/g在每一行的首行插入字符串new:1,$s/^/new/g在第二行 ...

  9. TCL随记(1)

    string 函数: string compare [-nocase] [-length int] str1 str2 把字符串str1和str2进行比较,返回值为-1/0/1,分别对应str1小于/ ...

  10. SPFA 原理剖析代码实现分析比较

    算法简介 SPFA(Shortest Path Faster Algorithm)是Bellman-Ford算法的一种队列实现,减少了不必要的冗余计算. 算法流程 算法大致流程是用一个队列来进行维护. ...