![]() |
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 |
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 |
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.