mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-07-02 19:21:39 +02:00
fix CN extraction for older openssl versions
This commit is contained in:
+2
-2
@@ -926,14 +926,14 @@ extract_altnames() {
|
|||||||
printf "%s" "${altnames}" | tr '\n' ' '
|
printf "%s" "${altnames}" | tr '\n' ' '
|
||||||
else
|
else
|
||||||
# No SANs, extract CN
|
# No SANs, extract CN
|
||||||
altnames="$( <<<"${reqtext}" grep '^[[:space:]]*Subject:' | _sed -e 's/.* CN ?= ?([^ /,]*).*/\1/' )"
|
altnames="$( <<<"${reqtext}" grep '^[[:space:]]*Subject:' | _sed -e 's/.*[ /]CN ?= ?([^ /,]*).*/\1/' )"
|
||||||
printf "%s" "${altnames}"
|
printf "%s" "${altnames}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get last issuer CN in certificate chain
|
# Get last issuer CN in certificate chain
|
||||||
get_last_cn() {
|
get_last_cn() {
|
||||||
<<<"${1}" _sed 'H;/-----BEGIN CERTIFICATE-----/h;$!d;x' | "${OPENSSL}" x509 -noout -issuer | head -n1 | _sed -e 's/.* CN ?= ?([^/,]*).*/\1/'
|
<<<"${1}" _sed 'H;/-----BEGIN CERTIFICATE-----/h;$!d;x' | "${OPENSSL}" x509 -noout -issuer | head -n1 | _sed -e 's/.*[ /]CN ?= ?([^/,]*).*/\1/'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create certificate for domain(s) and outputs it FD 3
|
# Create certificate for domain(s) and outputs it FD 3
|
||||||
|
|||||||
Reference in New Issue
Block a user