polardbxengine/mysql-test/suite/auth_sec/t/openssl_cert_validity.test

23 lines
762 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

--source include/no_valgrind_without_big.inc
--echo #
--echo # Bug#20923066 SSL AND RSA KEY MATERIAL EXPIRATION SHOULD BE EXTENDED
--echo #
let VALIDITY_START= `show status like 'Ssl_server_not_before'`;
let VALIDITY_END= `show status like 'Ssl_server_not_after'`;
perl;
my @start_date = $ENV{'VALIDITY_START'} =~ /(\d+:\d+:\d+) (\d+)/;
my @end_date = $ENV{'VALIDITY_END'} =~ /(\d+:\d+:\d+) (\d+)/;
my $cert_validity= $end_date[1] - $start_date[1];
# The default validity is 3650 days, which typically misses four leap days.
# Thus, if the day is Jan 15 (we add some extra padding), work around it.
if ($ENV{'VALIDITY_START'} =~ /Jan\s+[1-5]/ && $cert_validity == 9) {
++$cert_validity;
}
print "Validity of certificate: $cert_validity years\n";
EOF