Reputation: 19
I use LWP::UserAgent, Date::Parse,Net::SSLeay qw(get_https3) for expiry date of ssl certificate it gives me 3 dates in which 1 is correct
I tried this method for fetching dates but it gives me 3 dates for this where one is correct and for other dates it gives wrong dates total I have to get dates of 20 urls it gives me 3 correct date and other are wrong and also it gives me 2-3 dates for per url
my $ua = LWP::UserAgent->new(
ssl_opts => {
SSL_verify_callback => sub {
my ($ok, $ctx_store) = @_;
my $cert = Net::SSLeay::X509_STORE_CTX_get_current_cert($ctx_store);
print Net::SSLeay::P_ASN1_TIME_get_isotime(
Net::SSLeay::X509_get_notAfter($cert) ), "\n";
return $ok;
},
},
);
my $url = 'https://pjf.nif.org/m/login';
I want a perfect date as shown in certification option on any url and
Upvotes: 0
Views: 281
Reputation: 132720
For the URL that you show in your example, there are three certificates: the root certificate from USERTrust, the intermediate certificate from Sectigo, and the website certificate. The dates correspond to the expiration of each of those. The Difference Between Root Certificates and Intermediate Certificates is a good read.
You likely want the closest date, which should be the expiry of the user certificate.
Upvotes: 1