这里是我的代码为什么LWP :: UserAgent GET请求使用HTTPS失败?
#!/path/to/perl
use strict;
use LWP::UserAgent;
use HTTP::Request::Common;
use Crypt::SSLeay;
$ENV{HTTPS_PROXY} = 'http://proxy:8080/';
$ENV{HTTPS_DEBUG} = 1;
my $myurl = "https://www.redhat.com";
my $ua = new LWP::UserAgent;
$ua->cookie_jar({});
$ua->protocols_allowed([ 'http','https']);
$ua->proxy(['http', 'https'], 'http://proxy:8080/');
my $page = $ua->get($myurl);
die "Error $myurl\n ", $page->status_line, "\n Aborting"
unless $page->is_success;
print "Success", $page1->content_type, " document!\n";
它返回
Error at https://www.redhat.com
400 Bad Request
Aborting at test.pl line 30.
有什么不对?
编辑:
显然,它是一种bug。但是,解决方法对我无效。
我有。有用。代理不是问题。我的原始帖子中存在一个错误。关于发送GET到代理的一些问题。但解决方法建议不适合我 – aks 2010-09-16 05:56:31