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- ...
随机推荐
- golang的函数
在golang中, 函数是第一类值(first-class object), 即函数可以赋值与被赋值. 换言之, 函数也可以作为ReceiverType, 定义自己的method. 实例: http. ...
- start apache2 failed in Ubuntu
Invalid command 'WSGIReloadMechanism', perhaps misspelled or defined by a module not included in the ...
- 无法解决“Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed”与“Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed”之间的冲突。正在随意选择“Newtonsoft.Jso
今天的程序莫名报错: 无法解决“Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed” ...
- Ubuntu 12.04 Desktop配置XAMPP【转】
转载:[ubuntu][xampp]开发环境配置 XAMPP 并不适用于生产环境,而仅供开发环境使用.XAMPP 被设置为尽量开放,并提供开发者任何他/她想要的功能.这对于开发环境来说是很棒的,但对于 ...
- [shell基础]——join命令
测试文本内容 # cat -n name1.txt 1 name1 alvin1 2 name2 alvin2 3 name3 alvin3 4 name4 alvin4 # cat -n name2 ...
- The finnacial statements,taxes and cash flow
This chapter-2 we learn about the the financial statements(财务报表),taxes and cash flow.We must pay par ...
- UVALive - 6955 Finding Lines 随机算法
题目链接: http://acm.hust.edu.cn/vjudge/contest/126968#problem/F 题意 给你n个点,问是否有>=p/100*n个点共线(p>=20& ...
- JSP页面批量选择&全选操作&选择回显
效果如下: js验证部分: 页面body部分: 附:控制器Controller中验证批量选择条件回显:
- highchart 导出图片, 显示空白
使用highchart时, 导出的图片会变空白.. 解决方案: 不要加载grid.js
- php __FILE__,__CLASS__等魔术变量,及实例(转)
今天看到一个魔术变量,是以前没见过的,__DIR__,我查了查,发现原来是php5.3新增的,顺便举几个例子,解释一下php的魔术变量 1,__FILE__ 文件的完整路径和文件名.如果用在被包含文件 ...