Last active
November 8, 2024 07:35
-
-
Save adrianwebb/3313395 to your computer and use it in GitHub Desktop.
Bash script to generate SSL key, passwordless pem, csr, and crt files
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
#!/bin/bash | |
function generate_ssl_cert { | |
cert_name=$1 | |
( | |
openssl genrsa -des3 -out ${cert_name}.key 1024 | |
openssl rsa -in ${cert_name}.key -out ${cert_name}.pem | |
openssl req -new -key ${cert_name}.pem -out ${cert_name}.csr | |
openssl x509 -req -days 365 -in ${cert_name}.csr -signkey ${cert_name}.pem -out ${cert_name}.crt | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment