Crypt-SSLeay
view release on metacpan or search on metacpan
eg/lwp-ssl-test view on Meta::CPAN
$ENV{HTTPS_CERT_FILE} = $opt_cert;
$ENV{HTTPS_KEY_FILE} = $opt_key;
$opt_cafile && ( $ENV{HTTPS_CA_FILE} = $opt_cafile );
$opt_cadir && ( $ENV{HTTPS_CA_DIR} = $opt_cadir );
my $url = shift || 'https://www.nodeworks.com';
my $ua = new LWP::UserAgent;
$ua->timeout(15);
my $req = new HTTP::Request('HEAD', $url);
my $res = $ua->request($req);
print Dumper($res);
t/02-live.t view on Meta::CPAN
plan skip_all => "Network tests disabled";
}
}
# Make sure prerequisites are there
BEGIN {
# Make sure LWP uses us even when IO::Socket::SSL
# is installed.
$Net::HTTPS::SSL_SOCKET_CLASS = 'Net::SSL';
use_ok('HTTP::Request');
use_ok('LWP::UserAgent');
use_ok('LWP::Protocol::https');
use_ok('Net::SSL');
}
use constant METHOD => 'HEAD';
use constant URL => 'https://rt.cpan.org/';
use constant PROXY_ADDR_PORT => 'localhost:3128';
test_connect_through_proxy(PROXY_ADDR_PORT);
t/02-live.t view on Meta::CPAN
sub test_connect {
my ($method, $url) = @_;
diag('[RT #73755] Cheat by disabling LWP::UserAgent host verification');
my $ua = LWP::UserAgent->new(
agent => "Crypt-SSLeay $Crypt::SSLeay::VERSION tester",
ssl_opts => { verify_hostname => 0 },
);
my $req = HTTP::Request->new;
$req->method($method);
$req->uri($url);
my $test_name = "$method $url";
my $res;
try {
$res = $ua->request($req);
}
( run in 0.255 second using v1.01-cache-2.11-cpan-de7293f3b23 )