Created
April 11, 2013 11:58
-
-
Save felixhummel/5362818 to your computer and use it in GitHub Desktop.
startssl class1 helper
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 | |
[[ -z $2 ]] && echo "Usage: $0 POSTMASTER_EMAIL FULL_DOMAIN_NAME" && exit 1 | |
postmaster_email=$1 | |
full_domain_name=$2 | |
req_file=${full_domain_name}/req | |
key_file=${full_domain_name}/key | |
crt_file=${full_domain_name}/crt | |
chain=${full_domain_name}/chain | |
[[ -f $key_file ]] && echo "Keyfile exists: ${key_file}" && exit 1 | |
mkdir ${full_domain_name} | |
KEY_LENGTH=2048 | |
openssl req \ | |
-new -newkey rsa:${KEY_LENGTH} -nodes \ | |
-subj "/CN=${full_domain_name}/C=DE/E=${postmaster_email}" \ | |
-keyout ${key_file} -out ${req_file} | |
echo '--------------[ REQUEST CONTENTS ]--------------' | |
cat ${req_file} | |
echo '------------------------------------------------' | |
echo "Paste in ${crt_file}" | |
echo "Then run:" | |
echo "cat ${crt_file} sub.class1.server.ca.pem ca.pem > ${chain}" | |
echo "And copy to server:" | |
echo "scp -r ${full_domain_name} SERVER:CERTS" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment