Last active
April 25, 2022 07:22
-
-
Save Pothulapati/a7c68e073cdbf8573f12b64320711ce5 to your computer and use it in GitHub Desktop.
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
| # Create a private Key | |
| openssl genrsa -des3 -out myCA.key 2048 | |
| # Create a CA cert | |
| openssl req -x509 -new -nodes -key myCA.key -sha256 -days 1825 -out myCA.pem | |
| openssl genrsa -out $DOMAIN.key 2048 | |
| openssl req -new -key $DOMAIN.key -out $DOMAIN.csr | |
| cat > $DOMAIN.ext << EOF | |
| authorityKeyIdentifier=keyid,issuer | |
| basicConstraints=CA:FALSE | |
| keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment | |
| subjectAltName = @alt_names | |
| [alt_names] | |
| DNS.1 = $DOMAIN | |
| DNS.2 = *.$DOMAIN | |
| DNS.3 = *.ws.$DOMAIN | |
| EOF | |
| openssl x509 -req -in $DOMAIN.csr -CA ../myCA.pem -CAkey ../myCA.key -CAcreateserial \ | |
| -out $DOMAIN.crt -days 825 -sha256 -extfile $DOMAIN.ext |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment