Created
November 26, 2016 06:43
-
-
Save zdying/d9d1e2b8c6e8e899cb180eec609c0116 to your computer and use it in GitHub Desktop.
利用CA根证书创建自签名证书
This file contains hidden or 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
read -p "Enter your domain [www.example.com]: " DOMAIN | |
echo "Create A Certificate ..." | |
openssl genrsa -out $DOMAIN.key 2048 | |
echo "generate the certificate signing request ..." | |
#SUBJECT="/C=CN/ST=BeiJing/L=/O=hiipack/OU=DEV/CN=hiipack/[email protected]" | |
openssl req -new -key $DOMAIN.key -out $DOMAIN.csr | |
echo "sign the CSR, which requires the CA root key ..." | |
openssl x509 -req -in $DOMAIN.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out $DOMAIN.crt -days 500 -sha256 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment