Skip to content

Instantly share code, notes, and snippets.

@adrianwebb
Last active April 23, 2016 13:32
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adrianwebb/3313395 to your computer and use it in GitHub Desktop.
Save adrianwebb/3313395 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