#!/usr/bin/env perl use strict; use warnings; use SSLTest; ############################################################################### # code, msg, headers, content my %urls = ( '/somefile.txt' => { code => "200", msg => "Dontcare", headers => { "Content-type" => "text/plain", }, content => "blabla", }, ); my $cdir = $ENV{'PWD'}; # HOSTALIASES env variable allows us to create hosts file alias. my $testhostname = "WgetTestingServer"; my $testhostfile = "$cdir/wgethosts"; open(my $fh, '>', $testhostfile); print $fh "$testhostname 127.0.0.1\n"; close $fh; $ENV{'HOSTALIASES'} = "$cdir/wgethosts"; my $cmdline = $WgetTest::WGETPATH . " --secure-protocol=PFS --ca-certificate=$cdir/certs/test-ca-cert.pem https://$testhostname:55443/somefile.txt"; my $expected_error_code = 0; my %existing_files = ( ); my %expected_downloaded_files = ( 'somefile.txt' => { content => "blabla", }, ); my $sslsock = SSLTest->new(cmdline => $cmdline, input => \%urls, errcode => $expected_error_code, existing => \%existing_files, output => \%expected_downloaded_files); exit $sslsock->run(); # vim: et ts=4 sw=4