Commit d1e573c0 authored by Bernd Zeimetz's avatar Bernd Zeimetz

Keep registration information as json.

In some cases you need your registration id,
for example if you want to request a rate limit exception.
So keep the new-reg output on disk.
parent bfeb21ad
private_key.pem private_key.pem
private_key.json
domains.txt domains.txt
config.sh config.sh
hook.sh hook.sh
......
...@@ -36,6 +36,9 @@ ...@@ -36,6 +36,9 @@
# Location of private account key (default: $BASEDIR/private_key.pem) # Location of private account key (default: $BASEDIR/private_key.pem)
#PRIVATE_KEY="${BASEDIR}/private_key.pem" #PRIVATE_KEY="${BASEDIR}/private_key.pem"
# Location of private account registration information (default: $BASEDIR/private_key.json)
#PRIVATE_KEY_JSON="${BASEDIR}/private_key.json"
# Default keysize for private keys (default: 4096) # Default keysize for private keys (default: 4096)
#KEYSIZE="4096" #KEYSIZE="4096"
......
...@@ -60,6 +60,7 @@ load_config() { ...@@ -60,6 +60,7 @@ load_config() {
HOOK_CHAIN="no" HOOK_CHAIN="no"
RENEW_DAYS="30" RENEW_DAYS="30"
PRIVATE_KEY= PRIVATE_KEY=
PRIVATE_KEY_JSON=
KEYSIZE="4096" KEYSIZE="4096"
WELLKNOWN= WELLKNOWN=
PRIVATE_KEY_RENEW="no" PRIVATE_KEY_RENEW="no"
...@@ -106,6 +107,7 @@ load_config() { ...@@ -106,6 +107,7 @@ load_config() {
[[ -d "${BASEDIR}" ]] || _exiterr "BASEDIR does not exist: ${BASEDIR}" [[ -d "${BASEDIR}" ]] || _exiterr "BASEDIR does not exist: ${BASEDIR}"
[[ -z "${PRIVATE_KEY}" ]] && PRIVATE_KEY="${BASEDIR}/private_key.pem" [[ -z "${PRIVATE_KEY}" ]] && PRIVATE_KEY="${BASEDIR}/private_key.pem"
[[ -z "${PRIVATE_KEY_JSON}" ]] && PRIVATE_KEY_JSON="${BASEDIR}/private_key.json"
[[ -z "${WELLKNOWN}" ]] && WELLKNOWN="${BASEDIR}/.acme-challenges" [[ -z "${WELLKNOWN}" ]] && WELLKNOWN="${BASEDIR}/.acme-challenges"
[[ -z "${LOCKFILE}" ]] && LOCKFILE="${BASEDIR}/lock" [[ -z "${LOCKFILE}" ]] && LOCKFILE="${BASEDIR}/lock"
...@@ -171,9 +173,9 @@ init_system() { ...@@ -171,9 +173,9 @@ init_system() {
[[ ! -z "${CA_NEW_REG}" ]] || _exiterr "Certificate authority doesn't allow registrations." [[ ! -z "${CA_NEW_REG}" ]] || _exiterr "Certificate authority doesn't allow registrations."
# If an email for the contact has been provided then adding it to the registration request # If an email for the contact has been provided then adding it to the registration request
if [[ -n "${CONTACT_EMAIL}" ]]; then if [[ -n "${CONTACT_EMAIL}" ]]; then
signed_request "${CA_NEW_REG}" '{"resource": "new-reg", "contact":["mailto:'"${CONTACT_EMAIL}"'"], "agreement": "'"$LICENSE"'"}' > /dev/null signed_request "${CA_NEW_REG}" '{"resource": "new-reg", "contact":["mailto:'"${CONTACT_EMAIL}"'"], "agreement": "'"$LICENSE"'"}' > "${PRIVATE_KEY_JSON}"
else else
signed_request "${CA_NEW_REG}" '{"resource": "new-reg", "agreement": "'"$LICENSE"'"}' > /dev/null signed_request "${CA_NEW_REG}" '{"resource": "new-reg", "agreement": "'"$LICENSE"'"}' > "${PRIVATE_KEY_JSON}"
fi fi
fi fi
......
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