From 3d7e9e62d10a170316ac348b65a1569058ddcb4f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 26 Feb 2024 17:06:38 +0100 Subject: [InstallHttps] Include chain in main pem for lighttpd Separate chain file never worked... --- scripts/install-https | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/install-https b/scripts/install-https index dd7b1db..143638e 100755 --- a/scripts/install-https +++ b/scripts/install-https @@ -45,15 +45,17 @@ op_import () # Create server.pem { cat "$C" + # If we have a chainfile, try to use it aswell + if [ -s "$CHAIN" ] && openssl x509 -noout -hash -in "$CHAIN" &> /dev/null \ + && [ "$( grep -c '^-----END' "$CHAIN" )" = "$( grep -c '^-----BEGIN' "$CHAIN" )" ]; then + echo + cat "$CHAIN" + fi echo cat "$K" } > "$CERT_KEY_FILE" chmod 0600 "$CERT_KEY_FILE" || exit 4 rm -f -- "$C" "$K" - # If we have a chainfile, try to use it aswell - if [ -s "$CHAIN" ]; then - openssl x509 -noout -hash -in "$CHAIN" >/dev/null 2>&1 && cp "$CHAIN" "$CHAIN_FILE" - fi post_setup_hook return 0 } -- cgit v1.2.3-55-g7522