mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-06-12 08:34:40 +02:00
Revert "Removed option to reuse old private keys." (useful for HKPK, see #195)
This reverts commit 4dc9953319.
This commit is contained in:
@@ -6,7 +6,6 @@ This file contains a log of major changes in letsencrypt.sh
|
|||||||
- PRIVATE_KEY config parameter has been renamed to ACCOUNT_KEY to avoid confusion with certificate keys
|
- PRIVATE_KEY config parameter has been renamed to ACCOUNT_KEY to avoid confusion with certificate keys
|
||||||
- deploy_cert hook now also has the certificates timestamp as standalone parameter
|
- deploy_cert hook now also has the certificates timestamp as standalone parameter
|
||||||
- Temporary files are now identifiable (template: letsencrypt.sh-XXXXXX)
|
- Temporary files are now identifiable (template: letsencrypt.sh-XXXXXX)
|
||||||
- Private keys are no longer reused
|
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- Added documentation to repository
|
- Added documentation to repository
|
||||||
|
|||||||
@@ -63,6 +63,9 @@
|
|||||||
# Minimum days before expiration to automatically renew certificate (default: 30)
|
# Minimum days before expiration to automatically renew certificate (default: 30)
|
||||||
#RENEW_DAYS="30"
|
#RENEW_DAYS="30"
|
||||||
|
|
||||||
|
# Regenerate private keys instead of just signing new certificates on renewal (default: no)
|
||||||
|
#PRIVATE_KEY_RENEW="no"
|
||||||
|
|
||||||
# Which public key algorithm should be used? Supported: rsa, prime256v1 and secp384r1
|
# Which public key algorithm should be used? Supported: rsa, prime256v1 and secp384r1
|
||||||
#KEY_ALGO=rsa
|
#KEY_ALGO=rsa
|
||||||
|
|
||||||
|
|||||||
+12
-7
@@ -71,6 +71,7 @@ load_config() {
|
|||||||
ACCOUNT_KEY_JSON=
|
ACCOUNT_KEY_JSON=
|
||||||
KEYSIZE="4096"
|
KEYSIZE="4096"
|
||||||
WELLKNOWN=
|
WELLKNOWN=
|
||||||
|
PRIVATE_KEY_RENEW="no"
|
||||||
KEY_ALGO=rsa
|
KEY_ALGO=rsa
|
||||||
OPENSSL_CNF="$(openssl version -d | cut -d\" -f2)/openssl.cnf"
|
OPENSSL_CNF="$(openssl version -d | cut -d\" -f2)/openssl.cnf"
|
||||||
CONTACT_EMAIL=
|
CONTACT_EMAIL=
|
||||||
@@ -502,12 +503,16 @@ sign_domain() {
|
|||||||
mkdir -p "${BASEDIR}/certs/${domain}"
|
mkdir -p "${BASEDIR}/certs/${domain}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo " + Generating private key..."
|
privkey="privkey.pem"
|
||||||
privkey="privkey-${timestamp}.pem"
|
# generate a new private key if we need or want one
|
||||||
case "${KEY_ALGO}" in
|
if [[ ! -r "${BASEDIR}/certs/${domain}/privkey.pem" ]] || [[ "${PRIVATE_KEY_RENEW}" = "yes" ]]; then
|
||||||
rsa) _openssl genrsa -out "${BASEDIR}/certs/${domain}/privkey-${timestamp}.pem" "${KEYSIZE}";;
|
echo " + Generating private key..."
|
||||||
prime256v1|secp384r1) _openssl ecparam -genkey -name "${KEY_ALGO}" -out "${BASEDIR}/certs/${domain}/privkey-${timestamp}.pem";;
|
privkey="privkey-${timestamp}.pem"
|
||||||
esac
|
case "${KEY_ALGO}" in
|
||||||
|
rsa) _openssl genrsa -out "${BASEDIR}/certs/${domain}/privkey-${timestamp}.pem" "${KEYSIZE}";;
|
||||||
|
prime256v1|secp384r1) _openssl ecparam -genkey -name "${KEY_ALGO}" -out "${BASEDIR}/certs/${domain}/privkey-${timestamp}.pem";;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
# Generate signing request config and the actual signing request
|
# Generate signing request config and the actual signing request
|
||||||
echo " + Generating signing request..."
|
echo " + Generating signing request..."
|
||||||
@@ -761,7 +766,7 @@ command_help() {
|
|||||||
command_env() {
|
command_env() {
|
||||||
echo "# letsencrypt.sh configuration"
|
echo "# letsencrypt.sh configuration"
|
||||||
load_config
|
load_config
|
||||||
typeset -p CA LICENSE CHALLENGETYPE HOOK HOOK_CHAIN RENEW_DAYS ACCOUNT_KEY ACCOUNT_KEY_JSON KEYSIZE WELLKNOWN OPENSSL_CNF CONTACT_EMAIL LOCKFILE
|
typeset -p CA LICENSE CHALLENGETYPE HOOK HOOK_CHAIN RENEW_DAYS ACCOUNT_KEY ACCOUNT_KEY_JSON KEYSIZE WELLKNOWN PRIVATE_KEY_RENEW OPENSSL_CNF CONTACT_EMAIL LOCKFILE
|
||||||
}
|
}
|
||||||
|
|
||||||
# Main method (parses script arguments and calls command_* methods)
|
# Main method (parses script arguments and calls command_* methods)
|
||||||
|
|||||||
@@ -140,7 +140,6 @@ _TEST "Run in cron mode again, this time adding third domain, should force renew
|
|||||||
./letsencrypt.sh --cron --domain "${TMP_URL}" --domain "${TMP2_URL}" --domain "${TMP3_URL}" > tmplog 2> errorlog || _FAIL "Script execution failed"
|
./letsencrypt.sh --cron --domain "${TMP_URL}" --domain "${TMP2_URL}" --domain "${TMP3_URL}" > tmplog 2> errorlog || _FAIL "Script execution failed"
|
||||||
_CHECK_LOG "Domain name(s) are not matching!"
|
_CHECK_LOG "Domain name(s) are not matching!"
|
||||||
_CHECK_LOG "Forcing renew."
|
_CHECK_LOG "Forcing renew."
|
||||||
_CHECK_LOG "Generating private key"
|
|
||||||
_CHECK_LOG "Requesting challenge for ${TMP_URL}"
|
_CHECK_LOG "Requesting challenge for ${TMP_URL}"
|
||||||
_CHECK_LOG "Requesting challenge for ${TMP2_URL}"
|
_CHECK_LOG "Requesting challenge for ${TMP2_URL}"
|
||||||
_CHECK_LOG "Requesting challenge for ${TMP3_URL}"
|
_CHECK_LOG "Requesting challenge for ${TMP3_URL}"
|
||||||
@@ -165,7 +164,7 @@ _TEST "Run in cron mode one last time, with domain in domains.txt and force-resi
|
|||||||
./letsencrypt.sh --cron --force > tmplog 2> errorlog || _FAIL "Script execution failed"
|
./letsencrypt.sh --cron --force > tmplog 2> errorlog || _FAIL "Script execution failed"
|
||||||
_CHECK_LOG "Checking domain name(s) of existing cert... unchanged."
|
_CHECK_LOG "Checking domain name(s) of existing cert... unchanged."
|
||||||
_CHECK_LOG "Ignoring because renew was forced!"
|
_CHECK_LOG "Ignoring because renew was forced!"
|
||||||
_CHECK_LOG "Generating private key"
|
_CHECK_NOT_LOG "Generating private key"
|
||||||
_CHECK_LOG "Requesting challenge for ${TMP_URL}"
|
_CHECK_LOG "Requesting challenge for ${TMP_URL}"
|
||||||
_CHECK_LOG "Requesting challenge for ${TMP2_URL}"
|
_CHECK_LOG "Requesting challenge for ${TMP2_URL}"
|
||||||
_CHECK_LOG "Requesting challenge for ${TMP3_URL}"
|
_CHECK_LOG "Requesting challenge for ${TMP3_URL}"
|
||||||
|
|||||||
Reference in New Issue
Block a user