Created
April 4, 2014 13:59
-
-
Save jebai0521/9975293 to your computer and use it in GitHub Desktop.
tomcat 自签发ssl 证书
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 生成keystore | |
注册在填写名子与姓氏时需要填写tomcat的主机ip地址 | |
keytool -genkey -v -alias tomcat -keyalg RSA -keystore tomcat.keystore -validity 365 | |
2. 准备生成 CA 的key | |
openssl genrsa -out myCA.key 2048 | |
3. 生成 CA | |
openssl req -x509 -new -key myCA.key -out myCA.cer -days 730 -subj /CN="Sencloudx Custom CA" | |
4. 准备从 CA 请求认证的请求文件 | |
keytool -certreq -alias tomcat -keystore tomcat.keystore -file server.csr | |
5. 从CA请求认证 | |
openssl x509 -req -in server.csr -out server.cer -CAkey myCA.key -CA myCA.cer -days 365 -CAcreateserial -CAserial serial | |
6. 导入 CA 根证书 | |
keytool -import -trustcacerts -keystore tomcat.keystore -alias root -file myCA.cer | |
7. 导入认证证书 | |
keytool -import -keystore tomcat.keystore -alias tomcat -file server.cer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment