From a26e6f3527f3ada11eb8f22b4d0f1ae189a7cadb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Mon, 8 May 2017 11:35:22 +0200 Subject: [PATCH] * tests/Test-https-*: Change server port to <= 32767 --- tests/Test-https-badcerts.px | 2 +- tests/Test-https-clientcert.px | 4 ++-- tests/Test-https-crl.px | 2 +- tests/Test-https-pfs.px | 10 +++++++++- tests/Test-https-selfsigned.px | 4 ++-- tests/Test-https-tlsv1.px | 2 +- tests/Test-https-tlsv1x.px | 2 +- 7 files changed, 17 insertions(+), 9 deletions(-) diff --git a/tests/Test-https-badcerts.px b/tests/Test-https-badcerts.px index 381393ba..92da7b68 100755 --- a/tests/Test-https-badcerts.px +++ b/tests/Test-https-badcerts.px @@ -128,7 +128,7 @@ unless(-e $servercrt && -e $serverkey && $servercheck == 1) # Retry the test with --no-check-certificate. expect success -$port = 50443; +$port = 20443; $cmdline = $WgetTest::WGETPATH . " --ca-certificate=$cacrt". " https://$testhostname:$port/somefile.txt"; diff --git a/tests/Test-https-clientcert.px b/tests/Test-https-clientcert.px index f6335612..37ffda44 100755 --- a/tests/Test-https-clientcert.px +++ b/tests/Test-https-clientcert.px @@ -98,7 +98,7 @@ unless(-e $clientcert && -e $clientkey && $clientcheck == 1) } # Try Wget using SSL with mismatched client cert & key . Expect error -my $port = 51443; +my $port = 21443; my $cmdline = $WgetTest::WGETPATH . " --certificate=$clientcert ". " --private-key=$serverkey ". " --ca-certificate=$cacrt". @@ -128,7 +128,7 @@ if ($sslsock->run() == 0) } # Retry wget using SSL with client certificate. Expect success -$port = 52443; +$port = 22443; $cmdline = $WgetTest::WGETPATH . " --certificate=$clientcert". " --private-key=$clientkey ". " --ca-certificate=$cacrt". diff --git a/tests/Test-https-crl.px b/tests/Test-https-crl.px index 4753e2a0..99713d28 100755 --- a/tests/Test-https-crl.px +++ b/tests/Test-https-crl.px @@ -125,7 +125,7 @@ unless(-e $crlfile) # openssl crl -text -in certs/root.crl.pem # Retry the test with CRL. Expect Failure. -$port = 53443; +$port = 23443; $cmdline = $WgetTest::WGETPATH . " --crl-file=$crlfile ". " --ca-certificate=$cacrt". " https://$testhostname:$port/somefile.txt"; diff --git a/tests/Test-https-pfs.px b/tests/Test-https-pfs.px index 44af51da..849a3985 100755 --- a/tests/Test-https-pfs.px +++ b/tests/Test-https-pfs.px @@ -3,6 +3,14 @@ use strict; use warnings; +# Skip this test rather than fail it when the module isn't installed +if (!eval {require IO::Socket::SSL;1;}) { + print STDERR "This test needs the perl module \"IO::Socket::SSL\".\n"; + print STDERR "Install e.g. on Debian with 'apt-get install libio-socket-ssl-perl'\n"; + print STDERR " or if using cpanminus 'cpanm IO::Socket::SSL' could be used to install it.\n"; + exit 77; # skip +} + use SSLTest; ############################################################################### @@ -31,7 +39,7 @@ my $cdir = $ENV{'PWD'}; my $testhostname = "WgetTestingServer"; $ENV{'HOSTALIASES'} = "$cdir/certs/wgethosts"; -my $port = 54443; +my $port = 24443; my $cmdline = $WgetTest::WGETPATH . " --secure-protocol=PFS". " --ca-certificate=$cdir/certs/test-ca-cert.pem". " https://$testhostname:$port/somefile.txt"; diff --git a/tests/Test-https-selfsigned.px b/tests/Test-https-selfsigned.px index 22286c2e..b4710a76 100755 --- a/tests/Test-https-selfsigned.px +++ b/tests/Test-https-selfsigned.px @@ -51,7 +51,7 @@ unless(-e $certfile && -e $keyfile && $sscheck == 1) } # Try Wget using SSL first without --no-check-certificate. expect error -my $port = 56443; +my $port = 26443; my $cmdline = $WgetTest::WGETPATH . " --ca-certificate=$cdir/certs/test-ca-cert.pem". " https://$testhostname:$port/somefile.txt"; my $expected_error_code = 5; @@ -79,7 +79,7 @@ if ($sslsock->run() == 0) } # Retry the test with --no-check-certificate. expect success -$port = 57443; +$port = 27443; $cmdline = $WgetTest::WGETPATH . " --no-check-certificate ". " --ca-certificate=$cdir/certs/test-ca-cert.pem". " https://$testhostname:$port/somefile.txt"; diff --git a/tests/Test-https-tlsv1.px b/tests/Test-https-tlsv1.px index 96bbfacb..55504cd4 100755 --- a/tests/Test-https-tlsv1.px +++ b/tests/Test-https-tlsv1.px @@ -31,7 +31,7 @@ my $cdir = $ENV{'PWD'}; my $testhostname = "WgetTestingServer"; $ENV{'HOSTALIASES'} = "$cdir/certs/wgethosts"; -my $port = 58443; +my $port = 28443; my $cmdline = $WgetTest::WGETPATH . " --secure-protocol=TLSv1". " --ca-certificate=$cdir/certs/test-ca-cert.pem". " https://$testhostname:$port/somefile.txt"; diff --git a/tests/Test-https-tlsv1x.px b/tests/Test-https-tlsv1x.px index cf35245c..3f968a77 100755 --- a/tests/Test-https-tlsv1x.px +++ b/tests/Test-https-tlsv1x.px @@ -31,7 +31,7 @@ my $cdir = $ENV{'PWD'}; my $testhostname = "WgetTestingServer"; $ENV{'HOSTALIASES'} = "$cdir/certs/wgethosts"; -my $port = 59443; +my $port = 29443; my $cmdline = $WgetTest::WGETPATH . " --secure-protocol=TLSv1_1". " --ca-certificate=$cdir/certs/test-ca-cert.pem". " https://$testhostname:$port/somefile.txt";