From af6ca18933ffc5bb02d2ced46342b8d7a6275acd Mon Sep 17 00:00:00 2001 From: Dirk Date: Wed, 31 Jan 2018 16:37:22 +0100 Subject: [PATCH] change certificate enddate not to contain the TZ offset --- testssl.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testssl.sh b/testssl.sh index 9606a09..dd3f19c 100755 --- a/testssl.sh +++ b/testssl.sh @@ -6195,7 +6195,7 @@ certificate_info() { out "$indent"; pr_bold " Certificate Expiration " - enddate=$(parse_date "$($OPENSSL x509 -in $HOSTCERT -noout -enddate 2>>$ERRFILE | cut -d= -f 2)" +"%F %H:%M %z" "%b %d %T %Y %Z") + enddate=$(parse_date "$($OPENSSL x509 -in $HOSTCERT -noout -enddate 2>>$ERRFILE | cut -d= -f 2)" +"%F %H:%M" "%b %d %T %Y %Z") startdate=$(parse_date "$($OPENSSL x509 -in $HOSTCERT -noout -startdate 2>>$ERRFILE | cut -d= -f 2)" +"%F %H:%M" "%b %d %T %Y %Z") days2expire=$(( $(parse_date "$enddate" "+%s" "%F %H:%M %z") - $(LC_ALL=C date "+%s") )) # in seconds days2expire=$((days2expire / 3600 / 24 )) @@ -6230,8 +6230,8 @@ certificate_info() { expok="HIGH" fi fi - outln " ($startdate --> $enddate)" - fileout "${json_prefix}expiration" "$expok" "Certificate Expiration : $expfinding ($startdate --> $enddate)" + outln " (UTC: $startdate --> $enddate)" + fileout "${json_prefix}expiration" "$expok" "Certificate Expiration : $expfinding (UTC: $startdate --> $enddate)" certificates_provided=1+$(grep -c "\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-" $TEMPDIR/intermediatecerts.pem) out "$indent"; pr_bold " # of certificates provided"; outln " $certificates_provided"