Subject: | Net-FTPSSL enhancements |
Date: | Wed, 11 Mar 2009 10:58:11 -0800 (PST) |
To: | <bug-Net-FTPSSL [...] rt.cpan.org> |
From: | TJ Saunders <tj [...] castaglia.org> |
Hello, sir. I'm currently using the Net-FTPSSL package for running some
FTPS tests in the proftpd test case.
To help exercise many of the code paths in proftpd's mod_tls, I needed a
way to specify many of the IO::Socket::SSL options, e.g. I needed to
configure a Net::FTPSSL object to use a client cert, to reuse SSL
sessions, etc.
To do this, using the Net-FTPSSL-0.07 version, I had to make the following
change in the new() subroutine in FTPSSL.pm:
my $obj = $type->start_SSL( $socket, SSL_version => $mode )
or return _croak_or_return( $socket, undef,
"$mode: " . IO::Socket::SSL::errstr () );
To be:
unless ( defined($arg{SSL_version}) ) {
$arg{SSL_version} = $use_ssl ? 'SSLv23' : 'TLSv1';
}
my $obj = $type->start_SSL( $socket, %arg )
or return _croak_or_return( $socket, undef,
IO::Socket::SSL::errstr () );
Note that this change also makes the 'useSSL' constructor option
unnecessary; the caller can simply set 'SSL_version' IO::Socket::SSL
option in arg. But that's a minor thing.
With this change, I can now do:
my $client = Net::FTPSSL->new($server,
Port => $port,
Encryption => 'E',
# IO::Socket::SSL options
SSL_version => 'TLSv1',
SSL_use_cert => 1,
SSL_cert_file => $client_cert,
SSL_key_file => $client_key,
SSL_verify_mode => 0x01,
SSL_reuse_ctx => $prev_client,
);
Also, in the Makefile.PL, the author is still listed as Marcos Dalla
Stella.
Cheers,
TJ
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Only those who will risk going too far can possibly find out how
far one can go.
-T.S. Eliot
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~