Created
July 10, 2015 08:10
-
-
Save danielhauck/5bf8dbcd29ffeb37a4bc to your computer and use it in GitHub Desktop.
Revisions
-
Daniel Hauck created this gist
Jul 10, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ # gen key if ! [ -a ./${DOMAIN}.key ]; then PASSPHRASE=$(apg -m 255) echo ${PASSPHRASE} | openssl genrsa -des3 -out ${DOMAIN}.key -passout stdin 4096 echo ${PASSPHRASE} | openssl rsa -in ${DOMAIN}.key -out ${DOMAIN}.key -passin stdin fi openssl req -new -key ${DOMAIN}.key -sha256 -nodes \ -subj "/C=${COUNTRY}/ST=${STATE}/L=${CITY}/O=${ORGANIZATION}/OU=${OU}/CN=${DOMAIN_NAME}/emailAddress=${ADMIN_MAIL}/subjectAltName=DNS.1=m.${DOMAIN}" > ${DOMAIN}.csr if [ $? == 0 ]; then openssl req -in ${DOMAIN}.csr -text -noout | less echo "HELL YEAH, your csr is ready!" exit 0 else echo "HELL NO, something went wrong!" exit 1 fi