diff --git a/build/check_embedded.pl b/build/check_embedded.pl index 131054e2..9ff196b2 100755 --- a/build/check_embedded.pl +++ b/build/check_embedded.pl @@ -1,5 +1,6 @@ #!/usr/bin/perl -w use File::Temp qw(tempfile); +use Date::Parse; while (<>) { @@ -78,6 +79,19 @@ print " *** PUBLIC KEY TOO SHORT ***\n"; } } + if (/Not After : (.*)$/) { + $notAfter = $1; + $days = (str2time($notAfter)-time())/86400.0; + if ($days < 0) { + print " *** EXPIRED ***\n"; + } elsif ($days < 30) { + $days = int($days); + print " *** expires in $days days\n"; + } elsif ($days < 90) { + $days = int($days); + print " expires in $days days\n"; + } + } } close SSL; #print " text lines: $#lines\n";