Created
July 10, 2015 08:10
-
-
Save danielhauck/5bf8dbcd29ffeb37a4bc to your computer and use it in GitHub Desktop.
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 characters
# 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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment