1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Make Test-proxied-https-auth.px pass, and ensure it returns the proper exit status when it does not.

This commit is contained in:
Micah Cowan 2008-06-22 12:58:03 -07:00
parent 8aef7c1f04
commit c98aeb0cc3
4 changed files with 61 additions and 5 deletions

View File

@ -1,3 +1,12 @@
2008-06-22 Micah Cowan <micah@cowan.name>
* Test-proxied-https-auth.px: Shift exit code so it falls in the
lower bits, and actually fails when it should. Use dynamic port,
instead of static port.
* certs/server-cert.pem, certs/server-key.pem: Apparently failed
to add these from 1.11.x repo. Fixed.
2008-06-12 Micah Cowan <micah@cowan.name> 2008-06-12 Micah Cowan <micah@cowan.name>
* FTPServer.pm, FTPTest.pm, HTTPServer.pm, HTTPTest.pm, * FTPServer.pm, FTPTest.pm, HTTPServer.pm, HTTPTest.pm,

View File

@ -5,7 +5,10 @@ use strict;
use WgetTest; # For $WGETPATH. use WgetTest; # For $WGETPATH.
use HTTP::Daemon; use HTTP::Daemon;
use HTTP::Request; 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 { sub get_request {
my $conn = shift; my $conn = shift;
@ -26,9 +29,7 @@ sub get_request {
sub do_server { sub do_server {
my $alrm = alarm 10; my $alrm = alarm 10;
my $s = HTTP::Daemon->new (LocalAddr => 'localhost', my $s = $SOCKET;
LocalPort => '8080',
ReuseAddr => 1) or die "Cannot create server!!!";
my $conn; my $conn;
my $rqst; my $rqst;
my $rspn; my $rspn;
@ -68,6 +69,10 @@ sub do_server {
'Content-Type' => 'text/plain', 'Content-Type' => 'text/plain',
'Connection' => 'close', 'Connection' => 'close',
], "foobarbaz\n"); ], "foobarbaz\n");
$rspn->protocol('HTTP/1.0');
print "=====\n";
print $rspn->as_string;
print "\n=====\n";
print $conn $rspn->as_string; print $conn $rspn->as_string;
} }
$conn->close; $conn->close;
@ -94,9 +99,11 @@ my $cmdline = $WgetTest::WGETPATH . " --user=fiddle-dee-dee"
. " --password=Dodgson -e https_proxy=localhost:{{port}}" . " --password=Dodgson -e https_proxy=localhost:{{port}}"
. " --no-check-certificate" . " --no-check-certificate"
. " https://no.such.domain/needs-auth.txt"; . " https://no.such.domain/needs-auth.txt";
$cmdline =~ s/{{port}}/$SOCKET->sockport()/e;
my $code = system($cmdline); my $code = system($cmdline);
system ('rm -f needs-auth.txt');
warn "Got code: $code\n" if $code; warn "Got code: $code\n" if $code;
kill ('TERM', $pid); kill ('TERM', $pid);
exit $code; exit ($code >> 8);

View File

@ -0,0 +1,22 @@
-----BEGIN CERTIFICATE-----
MIIDnDCCAwWgAwIBAgIJAIsoR6UicPPEMA0GCSqGSIb3DQEBBQUAMIGRMQswCQYD
VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTETMBEGA1UEBxMKU2FudGEgQ2xh
YTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMRQwEgYDVQQDEwtN
aWNhaCBDb3dhbjEfMB0GCSqGSIb3DQEJARYQbWljYWhAY293YW4ubmFtZTAeFw0w
ODA0MjIwNTQxNDBaFw0wODA1MjIwNTQxNDBaMIGRMQswCQYDVQQGEwJVUzETMBEG
A1UECBMKQ2FsaWZvcm5pYTETMBEGA1UEBxMKU2FudGEgQ2xhYTEhMB8GA1UEChMY
SW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMRQwEgYDVQQDEwtNaWNhaCBDb3dhbjEf
MB0GCSqGSIb3DQEJARYQbWljYWhAY293YW4ubmFtZTCBnzANBgkqhkiG9w0BAQEF
AAOBjQAwgYkCgYEAxgJGqBxMUjykBTWHg0jTAH59WbxV6JLMAirwskri0u9o6m9f
Xw/ZsteKxmypgvwPcDoqZFWF5TB4sEf2l2m7N++mOLtjS9PLBaE8Y0siF1+EMXrI
mffet9PeXXceuTMFx6bTzls7EwLMvmvSynwFK1j9EHH0mFA19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qdUINx1f2XR53+ltSiyXk77NpyUOj/2nGQd2RhsjC/gLHdU
J5152dOoYRmhftubfNr9Cend76rCkwLhZ1ZOa1LDgkT7HFD+4FIeW02opwGpRo/k
XxOIkI7EF3em1MXfbRq1GEXr/KBkTKKeiaVUYW4klytX9crOZ+Dxv9KZRANAPzuF
Tmx1gO4qJL2d8SXlNbUd4MRwCwK2CgUyUknL9kGkt98N2sYUyJETwSWUWbNnP31g
R0sUKSvJN1k8DfZTpP/8znW1kz+vPa66tuRjBRd96JNUDdqSHHywT4DnR/pUNzdG
uUD4/x4VgEwMcOYOKAFeOInn5pPINecU8EE4SehLODW3YdQW4hnxxaltuXPAkvNo
6ST/6HVi/iSJsfvqUuEEXw/SGRMB0aZ+YEIOn4hVnu+gE8N07tuyvQ==
-----END RSA PRIVATE KEY-----