Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ravensnowbird/30c233352af77d2a66a73c8ab78bf8ec to your computer and use it in GitHub Desktop.
Save ravensnowbird/30c233352af77d2a66a73c8ab78bf8ec to your computer and use it in GitHub Desktop.
Bash script to generate SSL key, passwordless pem, csr, and crt files
#!/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