From 97c19ebd39f0404390064e37c18378cce1685317 Mon Sep 17 00:00:00 2001 From: Gerhard Date: Fri, 14 Oct 2016 20:52:04 +0200 Subject: [PATCH] added '-' to allowed characters for the alt name check --- checkssl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/checkssl b/checkssl index 71af94b..d22e6f9 100755 --- a/checkssl +++ b/checkssl @@ -34,6 +34,7 @@ # 2016-08-25 typo correction (1.05) # 2016-08-25 removing set-x left in during some testing ... (1.06) # 2016-09-17 moved upgrade option (-u) so it works if only option. (1.07) +# 2016-10-14 added '-' to allowed characters for the alt name check # --------------------------------------------------------------------------- PROGNAME=${0##*/} @@ -323,7 +324,7 @@ while IFS= read -r DOMAIN; do if [[ -z $CERTINFO ]]; then PROBLEMS=$(echo "${PROBLEMS}- no certificate found") else - ALT_NAMES=$(echo "$CERTINFO" | openssl x509 -noout -text 2>/dev/null| grep "Subject Alternative Name" -A2 |grep -Eo "DNS:[a-zA-Z 0-9.]*" | cut -c 5-) + ALT_NAMES=$(echo "$CERTINFO" | openssl x509 -noout -text 2>/dev/null| grep "Subject Alternative Name" -A2 |grep -Eo "DNS:[a-zA-Z 0-9.-]*" | cut -c 5-) debug "ALT Names $ALT_NAMES" if [[ "$(echo "$ALT_NAMES" | grep "^${DOMAIN}")" == "${DOMAIN}" ]]; then ISSUEDTO="${DOMAIN} (alt)"