Added test infrastructure to support basic FTPS tests. This currently

supports only ftps:// URLs with --ftp-ssl-control specified, which
implicitly encrypts the control channel but not the data channels.  That
allows stunnel to be used with an unmodified ftp server in exactly the
same way that the test https server is set up.
Added test case 400 as a basic FTPS test.
This commit is contained in:
Dan Fandrich 2007-03-08 02:38:49 +00:00
parent 85daec253c
commit 1bfa7dfe39
5 changed files with 174 additions and 20 deletions

View file

@ -1,7 +1,7 @@
#!/usr/bin/env perl
#
# $Id$
# This is the HTTPS server designed for the curl test suite.
# This is the HTTPS and FTPS server designed for the curl test suite.
#
# It is actually just a layer that runs stunnel properly.
@ -18,14 +18,16 @@ my $stunnel = "stunnel";
my $verbose=0; # set to 1 for debugging
my $port = 8433; # just our default, weird enough
my $target_port = 8999; # test http-server port
my $port = 8991; # just our default, weird enough
my $target_port = 8999; # default test http-server port
my $path = `pwd`;
chomp $path;
my $srcdir=$path;
my $proto='https';
do {
if($ARGV[0] eq "-v") {
$verbose=1;
@ -33,6 +35,10 @@ do {
if($ARGV[0] eq "-w") {
return 0; # return success, means we have stunnel working!
}
elsif($ARGV[0] eq "-p") {
$proto=$ARGV[1];
shift @ARGV;
}
elsif($ARGV[0] eq "-r") {
$target_port=$ARGV[1];
shift @ARGV;
@ -52,7 +58,7 @@ do {
my $conffile="$path/stunnel.conf"; # stunnel configuration data
my $certfile="$srcdir/stunnel.pem"; # stunnel server certificate
my $pidfile="$path/.https.pid"; # stunnel process pid file
my $pidfile="$path/.$proto.pid"; # stunnel process pid file
open(CONF, ">$conffile") || return 1;
print CONF "
@ -79,7 +85,7 @@ my $version_ge_4=system("$stunnel -V 2>&1|grep '^stunnel.* on '>/dev/null 2>&1")
if ($version_ge_4) { $cmd="$stunnel $conffile"; }
if($verbose) {
print "HTTPS server: $cmd\n";
print uc($proto)." server: $cmd\n";
}
my $rc = system($cmd);