mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Allow proxied-https-auth test to function when building outside of source dir.
This commit is contained in:
parent
be20feb46f
commit
30385d6c5d
@ -1,3 +1,11 @@
|
|||||||
|
2009-06-11 Benjamin Wolsey <bwy@benjaminwolsey.de>
|
||||||
|
|
||||||
|
* Test-proxied-https-auth.px: Take an optional argument for the
|
||||||
|
top source directory, so we can find the cert and key.
|
||||||
|
|
||||||
|
* run-px: Provide the top source directory as an argument, so
|
||||||
|
scripts can find their way around.
|
||||||
|
|
||||||
2009-04-11 Steven Schubiger <stsc@member.fsf.org>
|
2009-04-11 Steven Schubiger <stsc@member.fsf.org>
|
||||||
|
|
||||||
* run-px: Skip testing with real rc files by setting
|
* run-px: Skip testing with real rc files by setting
|
||||||
|
@ -5,6 +5,15 @@ use warnings;
|
|||||||
|
|
||||||
use WgetTest; # For $WGETPATH.
|
use WgetTest; # For $WGETPATH.
|
||||||
|
|
||||||
|
my $cert_path;
|
||||||
|
my $key_path;
|
||||||
|
|
||||||
|
if (@ARGV) {
|
||||||
|
my $top_srcdir = shift @ARGV;
|
||||||
|
$key_path = "$top_srcdir/tests/certs/server-key.pem";
|
||||||
|
$cert_path = "$top_srcdir/tests/certs/server-cert.pem";
|
||||||
|
}
|
||||||
|
|
||||||
# Have we even built an HTTPS-supporting Wget?
|
# Have we even built an HTTPS-supporting Wget?
|
||||||
{
|
{
|
||||||
my @version_lines = `${WgetTest::WGETPATH} --version`;
|
my @version_lines = `${WgetTest::WGETPATH} --version`;
|
||||||
@ -55,8 +64,16 @@ sub do_server {
|
|||||||
$rspn = HTTP::Response->new(200, 'OK');
|
$rspn = HTTP::Response->new(200, 'OK');
|
||||||
$conn->send_response($rspn);
|
$conn->send_response($rspn);
|
||||||
|
|
||||||
$conn = IO::Socket::SSL->new_from_fd($conn->fileno, SSL_server => 1,
|
my %options = (
|
||||||
SSL_passwd_cb => sub { return "Hello"; })
|
SSL_server => 1,
|
||||||
|
SSL_passwd_cb => sub { return "Hello"; });
|
||||||
|
|
||||||
|
$options{SSL_cert_file} = $cert_path if ($cert_path);
|
||||||
|
$options{SSL_key_file} = $key_path if ($key_path);
|
||||||
|
|
||||||
|
my @options = %options;
|
||||||
|
|
||||||
|
$conn = IO::Socket::SSL->new_from_fd($conn->fileno, @options)
|
||||||
or die "Couldn't initiate SSL";
|
or die "Couldn't initiate SSL";
|
||||||
|
|
||||||
$rqst = &get_request($conn)
|
$rqst = &get_request($conn)
|
||||||
|
@ -63,7 +63,7 @@ my @tested;
|
|||||||
|
|
||||||
foreach my $test (@tests) {
|
foreach my $test (@tests) {
|
||||||
print "Running $test\n\n";
|
print "Running $test\n\n";
|
||||||
system("$^X -I$top_srcdir/tests $top_srcdir/tests/$test");
|
system("$^X -I$top_srcdir/tests $top_srcdir/tests/$test $top_srcdir");
|
||||||
push @tested, { name => $test, result => $? };
|
push @tested, { name => $test, result => $? };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user