Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions files/domain-validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ if ! test -f "${certpath}"; then
fi

# Get all subject alternative names from the certificate
certdomains=$(openssl x509 -in "${certpath}" -text -noout | grep -oP 'DNS:[^\s,]*' | sed 's/^DNS://g;')
certdomains=$(openssl x509 -in "${certpath}" -text -noout | grep -oE 'DNS:[^[:space:],]*' | sed 's/^DNS://g;')

# Sort and uniq all domains. Drop all Domains which occure twice
result=$(printf '%s\n%s' "${certdomains}" "${domains}" | sort | uniq -c | grep -Pcv '^[ \t]*2[ \t]')
result=$(printf '%s\n%s' "${certdomains}" "${domains}" | sort | uniq -c | grep -Ecv '^[[:blank:]]*2[[:blank:]]')

# If all requested domains are already in the certificate, the $result will be 0 otherwise > 0
if [ "${result}" -eq 0 ]; then
Expand Down
Loading