Skip to content

Instantly share code, notes, and snippets.

@6farer
Created March 9, 2016 15:40
Show Gist options
  • Save 6farer/650f0b93d972a4b77cfd to your computer and use it in GitHub Desktop.
Save 6farer/650f0b93d972a4b77cfd to your computer and use it in GitHub Desktop.
Generate SSL Certificates
#! /bin/bash
NAME=$1
if [ -z $NAME ]; then
echo "First parameter should be a name for the output files, e.g. devint.company.local"
exit -1
fi
openssl genrsa -out $NAME.key 2048
openssl req -new -key $NAME.key -out $NAME.csr
openssl x509 -req -days 1024 -in $NAME.csr -signkey $NAME.key -out $NAME.crt
echo
echo
echo "Done, see: $NAME.key, .csr, .crt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment