Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   How to find the SSL certificate's expiration. (http://www.velocityreviews.com/forums/t886406-how-to-find-the-ssl-certificates-expiration.html)

perlnovice 05-11-2004 07:16 PM

How to find the SSL certificate's expiration.
 
Hello all,

I would like to write a script running on a client to determine the
expiration date of a web server's SSL certificate. But I do not know
how to. Can anybody give me a hint.

Thanks in advance for your information.

Tuan

J. Gleixner 05-11-2004 11:17 PM

Re: How to find the SSL certificate's expiration.
 
perlnovice wrote:
> Hello all,
>
> I would like to write a script running on a client to determine the
> expiration date of a web server's SSL certificate. But I do not know
> how to. Can anybody give me a hint.


Hint: Start by searching the internet! Learn to use google.

Just for fun, after spending only a few minutes, I found:
http://www.mail-archive.com/mon@linu.../msg01187.html


lostriver 05-11-2004 11:24 PM

Re: How to find the SSL certificate's expiration.
 
On 11 May 2004 12:16:46 -0700, perlnovice wrote:
> I would like to write a script running on a client to determine the
> expiration date of a web server's SSL certificate. But I do not know
> how to. Can anybody give me a hint.


One way to do it is to use Net::SSLeay module available from CPAN.


#!/usr/local/bin/perl
use Net::SSLeay;

$site = shift || die "Usage: $0 URL\n";
(undef, undef, undef, $server_cert) = &Net::SSLeay::get_https3($site, 443, '/');

if ( defined ($server_cert) ) {
$from = Net::SSLeay::X509_get_notBefore($server_cert);
print Net::SSLeay::P_ASN1_UTCTIME_put2string($from), "\n";

$to = Net::SSLeay::X509_get_notAfter($server_cert);
print Net::SSLeay::P_ASN1_UTCTIME_put2string($to);
}
__END__



--
..signature: No such file or directory


All times are GMT. The time now is 04:12 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57