I have a script which is used to get content from Google. It work very well, but now it doesn't. I found a post on stackexchange and I upgrade the library version, but it still doesn't work: I cannot Connect to any HTTPS site using LWP::UserAgent
I have connectivity from the linux machine (telnet googleapis.com 443 works very well).
#!/usr/bin/perl
use CGI 'param';
use CGI::Carp 'fatalsToBrowser';
use DBI;
require LWP::UserAgent;
use LWP::Protocol::https;
use URI::Escape;
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
$access_token='xxx';
print "LWP::UserAgent: ".LWP::UserAgent->VERSION,"\n";
print "LWP::Protocol::https: ".LWP::Protocol::https->VERSION,"\n";
$url="https://www.googleapis.com/oauth2/v1/userinfo?access_token=$access_token";
my $ua = LWP::UserAgent->new(ssl_opts => { verify_hostname => 0 });
$ua->agent('Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36');
$ua->timeout(10);
$ua->env_proxy;
my $response = $ua->get("$url");
if ($response->is_success) {
print "Am adus cu succes contul de la google";
$text=$response->decoded_content; # or whatever
}
else {
print "Response error:".$response->status_line."\n";
}
1;
The error: 500 Can't connect to www.googleapis.com:443
Any idea why this is suddenly happen?
In some cases, you need to force SSLv3