openssl在tomcat里面的使用
来源:互联网 发布:电视如何看网络直播 编辑:程序博客网 时间:2024/06/05 03:43
参考内容:
http://www.jianshu.com/p/045f95c008a0
http://www.cnblogs.com/Persue-A-Good-Life/p/4040988.html
yum install -y zlib
mkdir /tmp/myca
cd /tmp/myca
1. 创建根证书密钥文件(自己做CA) root.key
openssl genrsa -des3 -out root.key 2048
输入两次密码,记好密码内容。
2. 创建根证书的申请文件 root.csr
openssl req -new -key root.key -out root.csr
输入第一步的密码
3. 创建一个自当前日期起为期一百年的根证书 root.crt
openssl x509 -req -days 36500 -sha256 -extfile /etc/pki/tls/openssl.cnf -extensions v3_ca -signkey root.key -in root.csr -out root.crt
openssl genrsa -des3 -out server.key 2048
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 36500 -sha256 -extfile /etc/pki/tls/openssl.cnf -extensions v3_req -CA root.crt -CAkey root.key -CAcreateserial -in server.csr -out server.crt
openssl genrsa -des3 -out client.key 2048
openssl req -new -key client.key -out client.csr
openssl x509 -req -days 36500 -sha256 -extfile /etc/pki/tls/openssl.cnf -extensions v3_req -CA root.crt -CAkey root.key -CAcreateserial -in client.csr -out client.crt
openssl pkcs12 -export -in /tmp/myca/client.crt -inkey /tmp/myca/client.key -out /tmp/myca/client.p12 -name "client"
http://www.jianshu.com/p/045f95c008a0
http://www.cnblogs.com/Persue-A-Good-Life/p/4040988.html
yum install -y zlib
mkdir /tmp/myca
cd /tmp/myca
1. 创建根证书密钥文件(自己做CA) root.key
openssl genrsa -des3 -out root.key 2048
输入两次密码,记好密码内容。
2. 创建根证书的申请文件 root.csr
openssl req -new -key root.key -out root.csr
输入第一步的密码
3. 创建一个自当前日期起为期一百年的根证书 root.crt
openssl x509 -req -days 36500 -sha256 -extfile /etc/pki/tls/openssl.cnf -extensions v3_ca -signkey root.key -in root.csr -out root.crt
openssl genrsa -des3 -out server.key 2048
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 36500 -sha256 -extfile /etc/pki/tls/openssl.cnf -extensions v3_req -CA root.crt -CAkey root.key -CAcreateserial -in server.csr -out server.crt
openssl pkcs12 -export -in /tmp/myca/server.crt -inkey /tmp/myca/server.key -out /tmp/myca/server.p12 -name "server"
注意这里面的密码123456789应该改为自己的密码
keytool -importkeystore -v -srckeystore /tmp/myca/server.p12 -srcstoretype pkcs12 -srcstorepass 123456789 -destkeystore /tmp/myca/server.keystore -deststoretype jks -deststorepass 12356789openssl genrsa -des3 -out client.key 2048
openssl req -new -key client.key -out client.csr
openssl x509 -req -days 36500 -sha256 -extfile /etc/pki/tls/openssl.cnf -extensions v3_req -CA root.crt -CAkey root.key -CAcreateserial -in client.csr -out client.crt
openssl pkcs12 -export -in /tmp/myca/client.crt -inkey /tmp/myca/client.key -out /tmp/myca/client.p12 -name "client"
下面这两行是给iis用的
openssl req -new -x509 -key root.key -out website.cer -days 36500 -subj /CN=www.xxx.comopenssl pkcs12 -export -out website.pfx -inkey root.key -in website.cer
然后修改tomcat的server.xml文件,增加以下内容
<Connector executor="tomcatThreadPoolHttps" port="8443"redirctPort="6064" protocol="org.apache.coyote.http11.Http11NioProtocol"SSLEnabled="true" maxHttpHeaderSize="8192" acceptCount="1000"enableLookups="false" scheme="https" secure="true" keystoreFile="${catalina.base}/conf/server.keystore" keystorePass="你的密码"clientAuth="false" sslProtocol="TLSv1.2" />
阅读全文
0 0
- openssl在tomcat里面的使用
- 在tomcat中测试ssl的时候使用openssl,需要生成一个客户端证书
- 使用tomcat在eclipse里面部署springmvc的mvn项目加载不到jar的问题
- OpenSSL 在Windows 下的使用
- linux下openssl在apache,tomcat的整合中的配置
- 在maven项目里面使用tomcat-maven-plugin
- 使用keytool + openssl 生成自签名的tomcat服务器证书
- 如何在tomcat里面编辑一个简单的xml
- txt在tomcat里面设置成下载的方式
- 在DataGrid里面使用CheckBox的例子
- 用openSSL创建证书,然后在tomcat上配置https使用
- 在asio中使用OpenSSL
- OpenSSL在Windows下使用vs2010的编译安装
- 在你的 iOS App中 使用 OpenSSL 库
- 在你的 iOS App中 使用 OpenSSL 库
- 在你的 iOS App中 使用 OpenSSL 库 转发
- OpenSSL在linux下的编译安装与使用
- 在你的 iOS App中 使用 OpenSSL 库
- redis requires Ruby version >= 2.2.2 系统默认 ruby 版本过低,导致 Redis 接口安装失败
- mybatis
- Android 技术的回顾第二篇《底部菜单》
- 马尔科夫场基本概念
- java笔记_2
- openssl在tomcat里面的使用
- Mysql数据库常用分库和分表方式
- [PAT]1021. Deepest Root (25)@Java实现
- Codeforces Round #441 (Div. 2, by Moscow Team Olympiad)
- 线性索引(稠密索引、稀疏索引即分块索引、多重表、倒排表)
- [Leetcode] 411. Minimum Unique Word Abbreviation 解题报告
- java @interface 注解类的应用
- 动态添加RADIOBUTTON
- VS2008+Qt+助手 智能提示不显示、Qt关键字不高亮的解决办法【已解决】