aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcepceslib.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/cepceslib.sh b/cepceslib.sh
index 4a10b71..b08ebb7 100755
--- a/cepceslib.sh
+++ b/cepceslib.sh
@@ -29,6 +29,9 @@ gen_csr() {
_cn="${CN:-$( hostname -f )}"
_san="${SANS:-$( hostname -s )}"
_san_list="$( echo "${_san}" | tr ',' '\n' | grep -E '.' | awk '{gsub("^","DNS."NR+1" = ",$0);print;}' )"
+ # openssl 1.1.1 uses ASN1:UTF8:valuehere but 3.0.0 uses ASN1:UTF8STRING:valuehere
+ #utf8identifier="$( openssl version 2>&1 | grep -qE '1\.1\.[0-9][a-z]' && echo UTF8 || echo UTF8STRING )"
+ utf8identifier="UTF8"
cat >"${_cnf}" <<EOFCONF
oid_section = new_oids
[ req ]
@@ -55,7 +58,7 @@ CN = ${_cn}
basicConstraints = CA:FALSE
keyUsage = digitalSignature, keyEncipherment
subjectAltName = @alt_names
-certificateTemplateName = ASN1:UTF8STRING:${TEMPLATE}
+certificateTemplateName = ASN1:${utf8identifier}:${TEMPLATE}
[ alt_names ]
# Important value
bgstack15