为jenkins增加ssl( http–>https)—linux系统
1. 生成私钥
openssl genrsa -out rsa_private.key 2048
2. 生成公钥
openssl rsa -in rsa_private.key -pubout -out rsa_public.key
3. 通过私钥生成SSL证书
openssl req -new -x509 -days 365 -key rsa_private.key -out example.com.crt
4. 生成ssl证书
openssl req -newkey rsa:2048 -nodes -keyout rsa_private.key -x509 -days 365 -out ca.crt
5. 将SSL证书转换为PKCS12格式
openssl pkcs12 -export -out jenkins_keystore.p12 -passout ‘pass:123456’ -inkey rsa_private.key -in example.com.crt -certfile ca.crt -name example.com
6. 将中间格式转换为Java密钥存储库
keytool -importkeystore -srckeystore jenkins_keystore.p12 -srcstorepass ‘123456’ -srcstoretype PKCS12 -srcalias example.com