From ad1527334c90424b101da3c6a03da3c46e301d8b Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 4 Apr 2016 22:09:18 +0200 Subject: Fetch intermediate certs from the url in the cert --- letsencrypt-helpers/make-combined-crt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'letsencrypt-helpers/make-combined-crt') diff --git a/letsencrypt-helpers/make-combined-crt b/letsencrypt-helpers/make-combined-crt index 2c6dc59..56a2989 100755 --- a/letsencrypt-helpers/make-combined-crt +++ b/letsencrypt-helpers/make-combined-crt @@ -41,7 +41,16 @@ fi if [ -e "$cn-letsencrypt.pem" ] ; then pem="$cn-letsencrypt.pem" - chain="extra/lets-encrypt-x1-cross-signed.pem" + + tmp=$(tempfile) + trap "rm -f '$tmp'" EXIT + issuers_uri="$(openssl x509 -in "$pem" -noout -text | grep 'CA Issuers - URI:' | cut -d':' -f2-)" + if [ "${issuers_uri#http}" != "$issuers_uri" ]; then + wget -q -O "$tmp" "$issuers_uri" + chain="$tmp" + else + chain="" + fi elif [ -e "$cn.pem" ] ; then pem="$cn.pem" if [ -e "$cn-chain.pem" ]; then -- cgit v1.2.3