Merge pull request #1062 from dcooper16/certificate_validity_dates

Fix extraction of certificate validity dates
This commit is contained in:
Dirk Wetter 2018-05-23 10:51:29 +02:00 committed by GitHub
commit d578adb05c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7451,8 +7451,10 @@ certificate_info() {
out "$indent"; pr_bold " Certificate Validity (UTC) "
# FreeBSD + OSX can't swallow the leading blank:
enddate="$(strip_leading_space "$(awk -F':' '/Not After/ { print $2":"$3":"$4 }' <<< "$cert_txt")")" # in GMT
startdate="$(strip_leading_space "$(awk -F':' '/Not Before/ { print $2":"$3":"$4 }' <<< "$cert_txt")")"
enddate="${cert_txt#*Validity*Not Before: *Not After : }"
enddate="${enddate%%GMT*}GMT"
startdate="${cert_txt#*Validity*Not Before: }"
startdate="${startdate%%GMT*}GMT"
enddate="$(parse_date "$enddate" +"%F %H:%M" "%b %d %T %Y %Z")"
startdate="$(parse_date "$startdate" +"%F %H:%M" "%b %d %T %Y %Z")"