in reply to ssl details cgi script

Hi,

Not working means its printing the website name perfectly that I passed from my HTML page but the expiry date is not coming. Though if I am hard coding the value of website name in cgi script, its correctly displaying the expiry date.

Thanks.

Replies are listed 'Best First'.
Re^2: ssl details cgi script
by poj (Abbot) on Jul 25, 2015 at 20:40 UTC

    It works for me using this html with www.google.com

    <html> <head> </head> <body> <form action="cgi-bin/test/expire.pl" method="post"> <input type="text" name="sitename"/> <input type="submit"/> </form> </body> </html>
    poj
      Is it also showing the expiry date? I used the similar HTML and tried the html suggested by you but still its only showing the website name not the expiry date.

      Thanks

        The problem appears when I use -T on the shebang but I can't explain why yet.
        Update : Untaiting fixes the problem. Try this
        #!/usr/bin/perl -wT use strict; use CGI ':standard'; use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use Net::SSL::ExpireDate; use POSIX qw(strftime); print header; print start_html('SSL Expire Dates'); my $t_site = param('sitename'); # change to suit $t_site =~ s/^\s+|\s+$//; if ( $t_site =~ /[^A-Za-z0-9.-]/ ){ print pre("Sitename [$t_site] not valid"); } else { $t_site =~ /(.+)/; my $sitename = $1; print pre("Site : ".$sitename); my $ed = Net::SSL::ExpireDate->new( https => $sitename ); if (defined $ed->expire_date) { print pre("Expires : ".$ed->expire_date); } else { print pre("Expires : NOT DEFINED"); } } my $now = strftime "%Y-%m-%d %T", localtime; print pre("Time now : $now"); print end_html;
        poj