I am using LWP::UserAgent version 6.03
to fetch the status of website.
my $ua = LWP::UserAgent->new(ssl_opts => {verify_hostname => 0},);
$ua->cookie_jar({});
$ua->agent('Mozilla/5.0');
push @{$ua->requests_redirectable}, 'POST';
push @{$ua->requests_redirectable}, 'GET';
my $url = 'https://foo.com'
$page = $ua->get($url);
print "Error ".$page->status_line."\n";
When I am running this code on my unix machine it giving the following status and the error message for LWP module.
#status
500 Can't connect to foo.com:443
#error
LWP::Protocol::https::Socket: SSL connect attempt failed with unknown
errorerror:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert
unexpected message at /usr/local/lib/perl5/site_perl/5.8.9/LWP/Protocol/http.pm line 51.
I tried to make use of answer given to similar question but it did not worked out. Need your valuable advice.
ran the debug
DEBUG: .../IO/Socket/SSL.pm:193: set domain to 2
DEBUG: .../IO/Socket/SSL.pm:1545: new ctx 74489552
DEBUG: .../IO/Socket/SSL.pm:334: socket not yet connected
DEBUG: .../IO/Socket/SSL.pm:336: socket connected
DEBUG: .../IO/Socket/SSL.pm:349: ssl handshake not started
DEBUG: .../IO/Socket/SSL.pm:379: set socket to non-blocking to enforce timeout=180
DEBUG: .../IO/Socket/SSL.pm:392: Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:402: ssl handshake in progress
DEBUG: .../IO/Socket/SSL.pm:412: waiting for fd to become ready: SSL wants a read first
DEBUG: .../IO/Socket/SSL.pm:432: socket ready, retrying connect
DEBUG: .../IO/Socket/SSL.pm:392: Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:1276: SSL connect attempt failed with unknown errorerror:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message
DEBUG: .../IO/Socket/SSL.pm:398: fatal SSL error: SSL connect attempt failed with unknown errorerror:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message
DEBUG: .../IO/Socket/SSL.pm:1276: IO::Socket::INET6 configuration failederror:00000000:lib(0):func(0):reason(0)
DEBUG: .../IO/Socket/SSL.pm:1582: free ctx 74489552 open=74489552
DEBUG: .../IO/Socket/SSL.pm:1590: OK free ctx 74489552`