X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=tests%2FTest-proxied-https-auth.px;h=182c9dbfa60f95e9fcaaecbdcd19bbe3db0e6915;hp=b732d553bab3f626a5d5e0e4260bfa88d21340e6;hb=c98aeb0cc3f98a5cb7f3b4986a175d355e6c239c;hpb=8aef7c1f04aa836a164c3dff15665c2cfccd60eb diff --git a/tests/Test-proxied-https-auth.px b/tests/Test-proxied-https-auth.px index b732d553..182c9dbf 100755 --- a/tests/Test-proxied-https-auth.px +++ b/tests/Test-proxied-https-auth.px @@ -5,7 +5,10 @@ use strict; use WgetTest; # For $WGETPATH. use HTTP::Daemon; use HTTP::Request; -use IO::Socket::SSL 'debug4'; +use IO::Socket::SSL; + +my $SOCKET = HTTP::Daemon->new (LocalAddr => 'localhost', + ReuseAddr => 1) or die "Cannot create server!!!"; sub get_request { my $conn = shift; @@ -26,9 +29,7 @@ sub get_request { sub do_server { my $alrm = alarm 10; - my $s = HTTP::Daemon->new (LocalAddr => 'localhost', - LocalPort => '8080', - ReuseAddr => 1) or die "Cannot create server!!!"; + my $s = $SOCKET; my $conn; my $rqst; my $rspn; @@ -68,6 +69,10 @@ sub do_server { 'Content-Type' => 'text/plain', 'Connection' => 'close', ], "foobarbaz\n"); + $rspn->protocol('HTTP/1.0'); + print "=====\n"; + print $rspn->as_string; + print "\n=====\n"; print $conn $rspn->as_string; } $conn->close; @@ -94,9 +99,11 @@ my $cmdline = $WgetTest::WGETPATH . " --user=fiddle-dee-dee" . " --password=Dodgson -e https_proxy=localhost:{{port}}" . " --no-check-certificate" . " https://no.such.domain/needs-auth.txt"; +$cmdline =~ s/{{port}}/$SOCKET->sockport()/e; my $code = system($cmdline); +system ('rm -f needs-auth.txt'); warn "Got code: $code\n" if $code; kill ('TERM', $pid); -exit $code; +exit ($code >> 8);