我对Perl和CentO不了解,因此我必须使HTTPS请求能够正常工作:
#!/usr/bin/env perl
#===============================================================================
use strict;
use warnings;
use utf8;
use feature ':5.10';
use Mojo::UserAgent;
our $ua = Mojo::UserAgent->new();
$ua->transactor->name('Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0');
my $res;
$res = $ua->get('https://example.org');
if ($res->error) {
print "error\n";
print $res->error . "\n";
print $res;
} else {
print "success";
}
CORE
Perl (v5.10.1, linux)
Mojolicious (6.66, Clinking Beer Mugs)
OPTIONAL
EV 4.0+ (n/a)
IO::Socket::Socks 0.64+ (n/a)
IO::Socket::SSL 1.94+ (n/a)
Net::DNS::Native 0.15+ (n/a)
但是脚本显示“错误”。看来问题在于未安装IO :: Socket :: SSL 1.94。但是我在CentOS 6上找不到它。