Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How to find the SSL certificate's expiration.

Reply
Thread Tools

How to find the SSL certificate's expiration.

 
 
perlnovice
Guest
Posts: n/a
 
      05-11-2004
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
 
Reply With Quote
 
 
 
 
J. Gleixner
Guest
Posts: n/a
 
      05-11-2004
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

 
Reply With Quote
 
 
 
 
lostriver
Guest
Posts: n/a
 
      05-11-2004
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:_ASN1_UTCTIME_put2string($from), "\n";

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



--
..signature: No such file or directory
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Response.Redirect from SSL to non SSL with port drops port. Sean Wolfe ASP .Net 1 04-28-2005 07:49 PM
SSL with backend SSL on CSS 11500 Olivier PELERIN Cisco 0 08-30-2004 08:30 PM
How to imbed non-SSL links within SSL pages without using code CW ASP .Net 2 05-02-2004 01:40 PM
From non-ssl area to ssl ara with a virtual href path? 620 ASP .Net 2 01-06-2004 09:58 PM



Advertisments