Created
March 9, 2016 15:40
-
-
Save 6farer/650f0b93d972a4b77cfd to your computer and use it in GitHub Desktop.
Generate SSL Certificates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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