Subject: | SSL_Client_Certificate not reused on data channel |
I'm currently implementing a small FTPS download script, using NET::FTPSSL version 0.22 and IO::Socket::SSL version 1.84.
Since v1.79, IO::Socket::SSL generates a warning when a connection is opened without peer verification turned on. As a response to this warning, I create my Net::FTPSSL instance like this:
my $ftps = Net::FTPSSL->new
($host, SSL_Client_Certificate =>
{SSL_verify_mode => SSL_VERIFY_PEER, SSL_ca_path => '/etc/ssl/certs'});
This works fine, I can connect and login without any trouble and no warning is shown. However, as soon as a data connection is required (e.g. when issuing $ftps->list), I receive the warning of IO::Socket::SSL:
*******************************************************************
Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client
is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER
together with SSL_ca_file|SSL_ca_path for verification.
If you really don't want to verify the certificate and keep the
connection open to Man-In-The-Middle attacks please set
SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application.
*******************************************************************
After digging a bit into the NET::FTPSSL code, I think that the data connection is supposed to reuse the context of the command connection - this seems not to be working, otherwise this warning would not be shown.