mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-06 08:49:45 +01:00
Merge pull request #1062 from dcooper16/certificate_validity_dates
Fix extraction of certificate validity dates
This commit is contained in:
commit
d578adb05c
@ -7451,8 +7451,10 @@ certificate_info() {
|
|||||||
out "$indent"; pr_bold " Certificate Validity (UTC) "
|
out "$indent"; pr_bold " Certificate Validity (UTC) "
|
||||||
|
|
||||||
# FreeBSD + OSX can't swallow the leading blank:
|
# FreeBSD + OSX can't swallow the leading blank:
|
||||||
enddate="$(strip_leading_space "$(awk -F':' '/Not After/ { print $2":"$3":"$4 }' <<< "$cert_txt")")" # in GMT
|
enddate="${cert_txt#*Validity*Not Before: *Not After : }"
|
||||||
startdate="$(strip_leading_space "$(awk -F':' '/Not Before/ { print $2":"$3":"$4 }' <<< "$cert_txt")")"
|
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")"
|
enddate="$(parse_date "$enddate" +"%F %H:%M" "%b %d %T %Y %Z")"
|
||||||
startdate="$(parse_date "$startdate" +"%F %H:%M" "%b %d %T %Y %Z")"
|
startdate="$(parse_date "$startdate" +"%F %H:%M" "%b %d %T %Y %Z")"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user