Skip to content

Instantly share code, notes, and snippets.

@adrianwebb
Last active November 8, 2024 07:35
Show Gist options
  • 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