Skip to content

Instantly share code, notes, and snippets.

@ianneub
Last active August 29, 2015 13:58
Show Gist options
  • Save ianneub/10193463 to your computer and use it in GitHub Desktop.
Save ianneub/10193463 to your computer and use it in GitHub Desktop.
Create an SSL CSR and key in one command.
#!/bin/bash
if [ -z $1 ]
then
echo "You must set a domain name."
exit 1
fi
# generate a private key and CSR
openssl req -nodes -newkey rsa:2048 \
-keyout "$1.key" -out "$1.csr" \
-subj "/C=US/ST=California/L=Los Angeles/O=$1/CN=$1"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment