Browse Source

Merge pull request #616 from atisne/fix-Domain_using_minus_character

Wrong SANS when domain contains a minus character
pull/619/head
Tim Kimber 5 years ago
committed by GitHub
parent
commit
1f10f677cb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      getssl

+ 1
- 2
getssl View File

@ -2578,11 +2578,10 @@ if [[ ${_CREATE_CONFIG} -eq 1 ]]; then
| openssl x509 2>/dev/null)
EX_SANS="www.${DOMAIN##\*.}"
if [[ -n "${EX_CERT}" ]]; then
# Putting this inside the EX_SANS line below doesn't work on Centos7
escaped_d=${DOMAIN/\*/\\\*}
EX_SANS=$(echo "$EX_CERT" \
| openssl x509 -noout -text 2>/dev/null| grep "Subject Alternative Name" -A2 \
| grep -Eo "DNS:[a-zA-Z 0-9.-\*]*" | sed "s@DNS:${escaped_d}@@g" | grep -v '^$' | cut -c 5-)
| grep -Eo "DNS:[a-zA-Z 0-9.\*-]*" | sed "s@DNS:${escaped_d}@@g" | grep -v '^$' | cut -c 5-)
EX_SANS=${EX_SANS//$'\n'/','}
fi
if [[ -n "${EX_SANS}" ]]; then


Loading…
Cancel
Save