-
-
Save eXenon/eefe9e22b5be2ae94937ad6487e31b66 to your computer and use it in GitHub Desktop.
Generate Self-Signed SSL Certificate without prompt
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
# Generate a passphrase | |
openssl rand -base64 48 > passphrase.txt | |
# Generate a Private Key | |
openssl genrsa -aes128 -passout file:passphrase.txt -out server.key 2048 | |
# Generate a CSR (Certificate Signing Request) | |
openssl req -new -passin file:passphrase.txt -key server.key -out server.csr \ | |
-subj "/C=FR/O=krkr/OU=Domain Control Validated/CN=*.krkr.io" | |
# Remove Passphrase from Key | |
cp server.key server.key.org | |
openssl rsa -in server.key.org -passin file:passphrase.txt -out server.key | |
# Generating a Self-Signed Certificate for 100 years | |
openssl x509 -req -days 36500 -in server.csr -signkey server.key -out server.crt | |
mv server.crt ssl.crt | |
mv server.key ssl.key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment