mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-05-19 13:26:54 +02:00
don't walk certificate chain for ACMEv2 (certificate contains chain by default)
This commit is contained in:
@@ -3,7 +3,7 @@ This file contains a log of major changes in dehydrated
|
|||||||
|
|
||||||
## [x.x.x] - xxxx-xx-xx
|
## [x.x.x] - xxxx-xx-xx
|
||||||
## Changed
|
## Changed
|
||||||
- ??
|
- Don't walk certificate chain for ACMEv2 (certificate contains chain by default)
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
- ??
|
- ??
|
||||||
|
|||||||
@@ -990,6 +990,7 @@ sign_domain() {
|
|||||||
|
|
||||||
# Create fullchain.pem
|
# Create fullchain.pem
|
||||||
echo " + Creating fullchain.pem..."
|
echo " + Creating fullchain.pem..."
|
||||||
|
if [[ ${API} -eq 1 ]]; then
|
||||||
cat "${crt_path}" > "${certdir}/fullchain-${timestamp}.pem"
|
cat "${crt_path}" > "${certdir}/fullchain-${timestamp}.pem"
|
||||||
local issuer_hash
|
local issuer_hash
|
||||||
issuer_hash="$(get_issuer_hash "${crt_path}")"
|
issuer_hash="$(get_issuer_hash "${crt_path}")"
|
||||||
@@ -1004,6 +1005,14 @@ sign_domain() {
|
|||||||
cat "${certdir}/chain-${timestamp}.pem" > "${CHAINCACHE}/${issuer_hash}.chain"
|
cat "${certdir}/chain-${timestamp}.pem" > "${CHAINCACHE}/${issuer_hash}.chain"
|
||||||
fi
|
fi
|
||||||
cat "${certdir}/chain-${timestamp}.pem" >> "${certdir}/fullchain-${timestamp}.pem"
|
cat "${certdir}/chain-${timestamp}.pem" >> "${certdir}/fullchain-${timestamp}.pem"
|
||||||
|
else
|
||||||
|
tmpcert="$(_mktemp)"
|
||||||
|
tmpchain="$(_mktemp)"
|
||||||
|
awk '{print >out}; /----END CERTIFICATE-----/{out=tmpchain}' out="${tmpcert}" tmpchain="${tmpchain}" "${certdir}/cert-${timestamp}.pem"
|
||||||
|
mv "${certdir}/cert-${timestamp}.pem" "${certdir}/fullchain-${timestamp}.pem"
|
||||||
|
mv "${tmpcert}" "${certdir}/cert-${timestamp}.pem"
|
||||||
|
mv "${tmpchain}" "${certdir}/chain-${timestamp}.pem"
|
||||||
|
fi
|
||||||
|
|
||||||
# Update symlinks
|
# Update symlinks
|
||||||
[[ "${privkey}" = "privkey.pem" ]] || ln -sf "privkey-${timestamp}.pem" "${certdir}/privkey.pem"
|
[[ "${privkey}" = "privkey.pem" ]] || ln -sf "privkey-${timestamp}.pem" "${certdir}/privkey.pem"
|
||||||
|
|||||||
Reference in New Issue
Block a user