Tomcat SSL 设置
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 设置的更多相关文章
- 运行两个以上tomcat的设置及内存设置
运行两个或以上tomcat的设置方法 1.解决端口冲突问题设置方法很简单,修改conf/server.xml配置文件中的3个端口即可.默认端口:8005.8080.8009.一般情况位置如下:**** ...
- keytool生成证书与Tomcat SSL配置
转自:http://tomhat.iteye.com/blog/2087673 一.Keytool介绍 Keytool是一个Java数据证书的管理工具.Keytool将密钥(key)和证书(certi ...
- SSL 通信原理及Tomcat SSL 配置
SSL 通信原理及Tomcat SSL 双向配置 目录1 参考资料 .................................................................. ...
- SSL 通信原理及Tomcat SSL 双向配置
SSL 通信原理及Tomcat SSL 双向配置 目录1 参考资料 .................................................................. ...
- ubuntu下apache2 安装 配置 卸载 CGI设置 SSL设置
一.安装.卸载apache2 apache2可直接用命令安装 sudo apt-get install apache2 卸载比较麻烦,必须卸干净,否则会影响ap ...
- Navicat(连接) -1之SSL 设置
SSL 设置 Secure Sockets Layer(SSL) 是一个通过网际网路传输私人文件的协定.为了安全连接,首先你需要做的是安装 OpenSSL 库和下载数据库源. 注意: 只限于 MySQ ...
- Tomcat内存设置详解
Java内存溢出详解 一.常见的Java内存溢出有以下三种: 1. java.lang.OutOfMemoryError: Java heap space ----JVM Heap(堆)溢出 JVM在 ...
- (转)Tomcat内存设置
Java内存溢出详解 一.常见的Java内存溢出有以下三种: 1. java.lang.OutOfMemoryError: Java heap space ----JVM Heap(堆)溢出 JVM在 ...
- 在Apache Tomcat 7设置redis作为session store
在Apache Tomcat 7设置redis作为session store //输出tomcat控制台日志 root@ubuntu:~# cd /usr/tomcat/apache-tomcat- ...
随机推荐
- urllib3 ProxyManager
ProxyManager is an HTTP proxy-aware subclass of PoolManager. It produces a singleHTTPConnectionPool ...
- Android -- TabHost、Fragment、状态保存、通信
工程结构 TabAFm到Ta ...
- 远航1617团队alpha版本分数分配与人员调动
一.根据项目开始初期的分数分配要求及项目发布后大家的讨论,我们对组内成员的分数分配如下: 刘昊岩 20.5 周 萱 20.0 林谋武 19.0 杨 帆 18.5 高小洲 21.0 谢勤政 21.5 ...
- php file_put_contents() 写入回车
PHP file_put_contents() 函数是一次性向文件写入字符串或追加字符串内容的最合适选择. file_put_contents() file_put_contents() 函数用于把字 ...
- 【Insertion Sorted List】cpp
题目: Sort a linked list using insertion sort. 代码: /** * Definition for singly-linked list. * struct L ...
- html5之canvas练习
代码地址:github.com/peng666/blogs 在线地址:http://peng666.github.io/blogs/
- RobotFramework-登录
*** Settings *** Library Selenium2Library *** Test Cases *** login [Setup] open browser http://XXX/X ...
- Using sql azure for Elmah
The MSDN docs contain the list of T-SQL that is either partially supported or not supported. For ex ...
- 中断(interrupt)、异常(exception)、陷入(trap)
原文出处:http://lhk518.blog.163.com/blog/static/3153998320084263554749/ 中断:是为了设备与CPU之间的通信.典型的有如服务请求,任务完成 ...
- 机器学习&&数据挖掘之一:决策树基础认识
决策树入门篇 前言:分类是数据挖掘中的主要分析手段,其任务就是对数据集进行学习并构造一个拥有预测功能的分类模型,用于预测未知样本的类标号,把类标号未知的样本按照某一规则映射到预先给定的类标号中. 分类 ...