赞
踩
生成SSL证书:
为了方便ca、服务器、客户端证书使用相同的密码:cnki1234
生成ca证书
keytool -genkeypair -keystore mycastore.jks -storepass cnki1234 -alias myca -validity 3650 -dname CN=ca,C=cn -ext bc:c
keytool -exportcert -keystore mycastore.jks -storepass cnki1234 -alias myca -rfc -file myca.cer
生成服务器证书
keytool -genkeypair -keystore server.keystore.jks -storepass cnki1234 -alias server -keypass cnki1234 -validity 3650 -dname CN=server,C=cn
keytool -certreq -keystore server.keystore.jks -storepass cnki1234 -alias server -keypass cnki1234 -file server.csr
keytool -gencert -keystore mycastore.jks -storepass cnki1234 -alias myca -keypass cnki1234 -validity 3650 -infile server.csr -outfile server.cer
keytool -importcert -keystore server.truststore.jks -storepass cnki1234 -alias myca -keypass cnki1234 -file myca.cer
keytool -importcert -keystore server.keystore.jks -storepass cnki1234 -alias myca -keypass cnki1234 -file myca.cer
keytool -importcert -keystore server.keystore.jks -storepass cnki1234 -alias server -keypass cnki1234 -file server.cer
生成客户端证书
keytool -genkeypair -keystore client1.keystore.jks -storepass cnki1234 -alias client1 -keypass cnki1234 -validity 3650 -dname CN=client1,C=cn
keytool -certreq -keystore client1.keystore.jks -storepass cnki1234 -alias client1 -keypass cnki1234 -file client1.csr
keytool -gencert -keystore mycastore.jks -storepass cnki1234 -alias myca -keypass cnki1234 -validity 3650 -infile client1.csr -outfile client1.cer
keytool -importcert -keystore client1.truststore.jks -storepass cnki1234 -alias myca -keypass cnki1234 -file myca.cer
keytool -importcert -keystore client1.keystore.jks -storepass cnki1234 -alias myca -keypass cnki1234 -file myca.cer
keytool -importcert -keystore client1.keystore.jks -storepass cnki1234 -alias client1 -keypass cnki1234 -file client1.cer
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。