Commit ea5b70a3 authored by et@corde.org's avatar et@corde.org Committed by Lukas Schauer

add CONTACT_EMAIL option on registration

parent 12c566b1
......@@ -17,3 +17,7 @@
# create new private key for each csr (yes|no)
#PRIVATE_KEY_RENEW=no
# email to use during the registration
#CONTACT_EMAIL=
......@@ -16,6 +16,7 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BASEDIR="${SCRIPTDIR}"
OPENSSL_CNF="$(openssl version -d | cut -d'"' -f2)/openssl.cnf"
ROOTCERT="lets-encrypt-x1-cross-signed.pem"
CONTACT_EMAIL=
# If exists load config from same directory as this script
if [[ -e "${BASEDIR}/config.sh" ]]; then
......@@ -250,7 +251,12 @@ thumbprint="$(printf '%s' "$(printf '%s' '{"e":"'"${pubExponent64}"'","kty":"RSA
# If we generated a new private key in the step above we have to register it with the acme-server
if [[ "${register}" = "1" ]]; then
echo "+ Registering account key with letsencrypt..."
signed_request "${CA}/acme/new-reg" '{"resource": "new-reg", "agreement": "'"$LICENSE"'"}' > /dev/null
# if an email for the contact has been provided then adding it to the registration request
if [ -n "${CONTACT_EMAIL}" ]; then
signed_request "${CA}/acme/new-reg" '{"resource": "new-reg", "contact":["mailto:'"${CONTACT_EMAIL}"'"], "agreement": "'"$LICENSE"'"}' > /dev/null
else
signed_request "${CA}/acme/new-reg" '{"resource": "new-reg", "agreement": "'"$LICENSE"'"}' > /dev/null
fi
fi
if [[ -e "${BASEDIR}/domains.txt" ]]; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment