Fix subject alternative name on darwin

This commit is contained in:
Jonathon Rossi 2015-08-18 17:15:17 +10:00
parent 9afab04012
commit e8cbf1a699
1 changed files with 2 additions and 3 deletions

View File

@ -1786,12 +1786,11 @@ run_server_defaults() {
fi fi
sans=$($OPENSSL x509 -in $HOSTCERT -noout -text | grep -A3 "Subject Alternative Name" | grep "DNS:" | \ sans=$($OPENSSL x509 -in $HOSTCERT -noout -text | grep -A3 "Subject Alternative Name" | grep "DNS:" | \
sed -e 's/DNS://g' -e 's/ //g' -e 's/,/\n/g' -e 's/othername:<unsupported>//g') sed -e 's/DNS://g' -e 's/ //g' -e 's/,/ /g' -e 's/othername:<unsupported>//g')
# ^^^ CACert # ^^^ CACert
pr_bold " subjectAltName (SAN) " pr_bold " subjectAltName (SAN) "
if [ -n "$sans" ]; then if [ -n "$sans" ]; then
sans=$(echo "$sans" | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g') # replace line feed by " "
for san in $sans; do for san in $sans; do
out "$underline$san$off " out "$underline$san$off "
done done