Debian lenny version packages
[pkg-perl] / deb-src / libnet-ssleay-perl / libnet-ssleay-perl-1.35 / t / external / 08_external.t
1 #!/usr/bin/perl
2 # Test complete connection a number of external SSL web servers
3
4 use strict;
5 use warnings;
6 use Test::More;
7 use Net::SSLeay;
8
9 my @sites = qw(
10         www.cdw.com
11         banking.wellsfargo.com
12         perldition.org
13         alioth.debian.org
14 );
15 @sites = split(/:/, $ENV{SSLEAY_SITES}) if exists $ENV{SSLEAY_SITES};
16 if (@sites) {
17     plan tests => scalar @sites * 2;
18 }
19 else {
20     plan skip_all => 'No external hosts specified for SSL testing';
21 }
22
23 my $site;
24 for $site (@sites) {
25     SKIP: {
26         my ($p, $r, %h) =  Net::SSLeay::get_https($site, 443, '/');
27         skip 'could not connect', 2 unless defined $h{'CONTENT-TYPE'};
28         pass('connection');
29         ok($r =~ /^HTTP\/1/s, 'correct response');
30     }
31 }