Skip Menu |

This queue is for tickets about the Net-FTPSSL CPAN distribution.

Report information
The Basics
Id: 47659
Status: resolved
Priority: 0/
Queue: Net-FTPSSL

People
Owner: Nobody in particular
Requestors: tj [...] castaglia.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.09
  • 0.10
Fixed in: 0.11



Subject: Net-FTPSSL-0.09 ccc() does not perform bidirection SSL shutdown
Date: Tue, 7 Jul 2009 10:29:02 -0700 (PDT)
To: bug-Net-FTPSSL [...] rt.cpan.org
From: TJ Saunders <tj [...] castaglia.org>
The ccc() method of Net::FTPSSL currently tells IO::Socket::SSL to skip the call to SSL_shutdown() (this is the recommended usage according to the IO::Socket::SSL docs). However, this makes Net::FTPSSL not handle the CCC command properly. Here's the example Perl code demonstrating the issue, and the expected behavior: my $user = 'proftpd'; my $passwd = 'test'; my $home_dir = '/tmp'; my $client_opts = { Encryption => 'E', Port => $port, Croak => 1, }; if ($ENV{TEST_VERBOSE}) { $client_opts->{Debug} = 1; } my $client = Net::FTPSSL->new('127.0.0.1', %$client_opts); unless ($client) { die("Can't connect to FTPS server: " . IO::Socket::SSL::errstr()); } unless ($client->login($user, $passwd)) { die("Can't login: " . $client->last_message()); } $client->ccc(); my $cwd = $client->pwd(); $client->quit(); $self->assert($home_dir eq $cwd); When executing this against proftpd-1.3.2 compiled with mod_tls, the resulting Net:FTPSSL debug shows: SKT <<< 220 ProFTPD 1.3.2 Server (ProFTPD) [127.0.0.1] SKT >>> AUTH TLS SKT <<< 234 AUTH TLS successful Show quoted text
>>> USER proftpd
<<< 331 Password required for proftpd Show quoted text
>>> PASS *******
<<< 230 User proftpd logged in Show quoted text
>>> PBSZ 0
<<< 200 PBSZ 0 successful Show quoted text
>>> PROT P
<<< 200 Protection set to Private Show quoted text
>>> CCC
<<< 200 Clearing control channel protection Show quoted text
>>> PWD
<<< +).mleěvt <<< WD :zaŀ^ntx=J0 After issuing the CCC command, the client should still be able to issue FTP commands such as PWD. But the above shows that Net::FTPSSL is not parsing/handling the responses from proftpd, after the CCC, properly. In the mod_tls log, with OpenSSL diagnostics enabled, for the above, I see: Jul 07 09:34:48 mod_tls/2.3[28335]: received CCC, clearing control channel protection Jul 07 09:34:48 mod_tls/2.3[28335]: [msg] sent TLSv1 warning 'close_notify' Alert message (2 bytes) Jul 07 09:34:48 mod_tls/2.3[28335]: [info] writing: SSL/TLS alert warning: close notify Jul 07 09:34:48 mod_tls/2.3[28335]: [msg] sent message of unknown version (22340) (2 bytes) Jul 07 09:34:48 mod_tls/2.3[28335]: [info] writing: SSL/TLS alert fatal: protocol version Jul 07 09:34:48 mod_tls/2.3[28335]: SSL_shutdown error [1]: (1) error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number This shows mod_tls (via the OpenSSL SSL_shutdown() call) sending the close_notify alert to the client. Notice, though, that the client does not send a close_notify alert in response. However, if the following code in FTPSSL.pm is changed from: # Stop SSL, but leave the socket open! unless ( $self->stop_SSL ( SSL_no_shutdown => 1 ) ) { to be: # Stop SSL, but leave the socket open! unless ( $self->stop_SSL ( SSL_no_shutdown => 0 ) ) { and the test tried again, the Net::FTPSSL debug log shows: SKT <<< 220 ProFTPD 1.3.2 Server (ProFTPD) [127.0.0.1] SKT >>> AUTH TLS SKT <<< 234 AUTH TLS successful Show quoted text
>>> USER proftpd
<<< 331 Password required for proftpd Show quoted text
>>> PASS *******
<<< 230 User proftpd logged in Show quoted text
>>> PBSZ 0
<<< 200 PBSZ 0 successful Show quoted text
>>> PROT P
<<< 200 Protection set to Private Show quoted text
>>> CCC
<<< 200 Clearing control channel protection Show quoted text
>>> PWD
<<< 257 "/tmp" is the current directory Show quoted text
>>> QUIT
<<< 221 Goodbye. Net::FTPSSL was able to parse/handle the PWD response this time. And in the mod_tls logs, again with OpenSSL diagnostics enabled, I the following for the above modified Net::FTPSSL code: Jul 07 10:17:32 mod_tls/2.3[29361]: received CCC, clearing control channel protection Jul 07 10:17:32 mod_tls/2.3[29361]: [msg] sent TLSv1 warning 'close_notify' Alert message (2 bytes) Jul 07 10:17:32 mod_tls/2.3[29361]: [info] writing: SSL/TLS alert warning: close notify Jul 07 10:17:32 mod_tls/2.3[29361]: [msg] received TLSv1 warning 'close_notify' Alert message (2 bytes) Jul 07 10:17:32 mod_tls/2.3[29361]: [info] reading: SSL/TLS alert warning: close notify This time, a full bidirectional shutdown of the SSL session occurred; the 'close_notify' alerts were sent and received by both peers. Section 12.3 of RFC 4217 shows that a bidirectional shutdown of the SSL session on the control channel is the expected behavior. Keep up the good work with the Net::FTPSSL module; I'm enjoying using it for my proftpd/mod_tls development! Cheers, TJ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Absence is to love what wind is to fire: it extinguishes the small, it enkindles the great. -Comte de Bussy-Rabutin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi TJ, Thank you very much for the report that ccc() doesn't work against proftpd-1.3.2 and the patch you supplied. I'll see about testing your patch against my FTPS server in the near future to see if it works there as well. Hopefully it's not a brand of FTPS server issue where some servers require "SSL_no_shutdown => 1" while others require "SSL_no_shutdown => 0". (I know the current code works for my non-proftpd servers.) But I'm pretty swamped right now so v0.11 is going to be a while. The current release of v0.10 has the same problem as v0.09 has with ccc(). In the mean time, can you please send me the versions of the following modules you are using? I'd also like to rule out it's not a dependancy on another module issue when I get to testing your patch. You can get the versions by running the following command. perl -w -e "use IO::Socket::SSL 99.0;" perl -w -e "use Net::SSLeay 99.0;" I'd also like what OS you are running your client code on as well as the Perl version. This will greatly help me with preparing the next release. Curtis
Subject: Re: [rt.cpan.org #47659] Net-FTPSSL-0.09 ccc() does not perform bidirection SSL shutdown
Date: Tue, 7 Jul 2009 14:46:27 -0700 (PDT)
To: Curtis Leach via RT <bug-Net-FTPSSL [...] rt.cpan.org>
From: TJ Saunders <tj [...] castaglia.org>
Show quoted text
> Thank you very much for the report that ccc() doesn't work against > proftpd-1.3.2 and the patch you supplied. I'll see about testing your > patch against my FTPS server in the near future to see if it works > there as well. Hopefully it's not a brand of FTPS server issue where > some servers require "SSL_no_shutdown => 1" while others > require "SSL_no_shutdown => 0". (I know the current code works for my > non-proftpd servers.)
What kind of test do you use for verifying ccc() against a server? The best test I've found is to issue some normal FTP commands (PWD, LIST, etc) after the CCC, to make sure that both the client and the server process the commands as appropriate. Show quoted text
> In the mean time, can you please send me the versions of the following > modules you are using? I'd also like to rule out it's not a > dependancy on another module issue when I get to testing your patch. > You can get the versions by running the following command. > > perl -w -e "use IO::Socket::SSL 99.0;"
familiar/tj>perl -w -e 'use IO::Socket::SSL 99.0;' IO::Socket::SSL version 99 required--this is only version 1.24 at -e line 1. BEGIN failed--compilation aborted at -e line 1. Show quoted text
> perl -w -e "use Net::SSLeay 99.0;"
familiar/tj>perl -w -e 'use Net::SSLeay 99.0;' Net::SSLeay version 99 required--this is only version 1.35 at -e line 1. BEGIN failed--compilation aborted at -e line 1. Show quoted text
> I'd also like what OS you are running your client code on as well as > the Perl version.
OS: Ubuntu Linux 9.05, 32-bit Perl: familiar/tj>perl -V Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Platform: osname=linux, osvers=2.6.24-19-server, archname=i486-linux-gnu-thread-multi uname='linux palmer 2.6.24-19-server #1 smp sat jul 12 00:40:01 utc 2008 i686 gnulinux ' config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i486-linux-gnu -Dprefix=/usr -Dprivlib=/usr/share/perl/5.10 -Darchlib=/usr/lib/perl/5.10 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.10.0 -Dsitearch=/usr/local/lib/perl/5.10.0 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -DDEBUGGING=-g -Doptimize=-O2 -Duseshrplib -Dlibperl=libperl.so.5.10.0 -Dd_dosuid -des' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2 -g', cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include' ccversion='', gccversion='4.3.3 20081217 (prerelease)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/lib64 libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt perllibs=-ldl -lm -lpthread -lc -lcrypt libc=/lib/libc-2.9.so, so=so, useshrplib=true, libperl=libperl.so.5.10.0 gnulibc_version='2.9' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Built under linux Compiled at Jan 5 2009 19:47:06 @INC: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl . Cheers, TJ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Once more upon the waters! yet once more! And the waves bound beneath me as as a steed That knows his rider. -Lord Byron ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Subject: Re: [rt.cpan.org #47659] Net-FTPSSL-0.09 ccc() does not perform bidirection SSL shutdown
Date: Tue, 7 Jul 2009 16:34:12 -0700 (PDT)
To: Curtis Leach via RT <bug-Net-FTPSSL [...] rt.cpan.org>
From: TJ Saunders <tj [...] castaglia.org>
Show quoted text
Just another minor nit: The perldoc for the ccc() method mentions: "Sends the clear command channel request to the SFTP server." I think what is meant is "FTPS server", not "SFTP server". Cheers, TJ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It is not our purpose to become each other; it is to recognize each other, to learn to see the other and honor him for what he is. -Hermann Hesse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi TJ, Nice catch on the FPTS/SFTP typo and thanks for providing the Perl info your program is running against. Per your request, attached is the test script I used to test out the ccc() command added in version 0.09. I should probably add it to 10- compex.t, but I never got arround to it. I hope I didn't introduce any typos when I took out some hard coded defaults to the main test server I used to test ccc() against. Just drop the script into the test directory with 10-compex.t and run it from there "perl t/05-ccc.t" Now I have bad news about your patch. I changed the value used for SSL_no_shudown from 1 to 0 and the patch hangs on my FTPS server. So it looks like the fix will have to be a bit more complex than just a one line change. Looks like some FTPS servers require it to be "1" and others require it to be "0" to work. So I'll have to look at making this value configurable somehow. Either as an argument to the ccc() command or as another option to "new". It's also possible that different versions of stop_SSL() work differently, or it's a Perl 5.8.8 vs 5.10 issue. We are using different versions of IO::Socket:SSL, v1.18 vs v1.24. So more research is needed on my end. Would you be willing to grant me temporary access to your FTPS server via a temporary account that Net::FTPSSL could use? So that I can quickly rule out a few things? So that I can verify the issue is strictly with your proftpd server and not our code differences. If you are willing, we can exchange that info off line via personal email addresses. Since I don't think you want that info floating around on a public site. Otherwise we might have to exchange updates to FTPSSL.pm between us as we try to rule out all the various differences. Thanks Curtis
# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl ./t/10-complex.t' ######################### # Goal here is to give as many success messagse as possible. # Especially when not all FTP servers support all functions. # So the logic here can be a bit convoluted. use strict; use Test::More tests => 14; # plan tests => 40; # Can't use due to BEGIN block BEGIN { use_ok('Net::FTPSSL') } # Test # 1 sleep (1); # So test 1 completes before the message prints! diag( "\nYou can also perform a deeper test." ); diag( "Some information will be required for this test:" ); diag( "A secure ftp server address, a user, a password and a directory" ); diag( "where the user has permissions to read and write." ); my $more_test = ask_yesno("Do you want to make a deeper test"); SKIP: { skip "Deeper test skipped for some reason...", 40 unless $more_test; my( $address, $server, $port, $user, $pass, $dir, $mode, $data, $encrypt_mode ); $address = ask("Server address ( server.org[:port] )"); $address = "server.org" unless ($address); $user = ask("\tUser (default 'anonymous')"); $pass = ask("\tPassword (default 'user\@localhost')"); $dir = ask("\tDirectory (default <HOME>)"); $mode = uc (ask("\tConnection mode (I)mplicit, (E)xplicit, or (C)lear. (default 'E')")); if ( $mode eq CLR_CRYPT ) { $data = $encrypt_mode = ""; # Make sure not undef ... } else { $data = uc (ask("\tData Connection mode (C)lear or (P)rotected. (default 'P')")); $encrypt_mode = "T"; } ( $server, $port ) = split( /:/, $address ); # INET didn't support despite comments elsewhere. # my @svrs = split (/,\s*/, $server); # if (scalar (@svrs) > 1) { $server = \@svrs; } # Requested list of servers # $port = 21 unless $port; # Let FTPSSL provide the default port. $mode = EXP_CRYPT unless $mode =~ /^(I|E|C|)$/; $data = DATA_PROT_PRIVATE unless $data =~ /^(C|S|E|P|)$/; $user = 'anonymous' unless $user; $pass = 'user@localhost' unless $pass; $encrypt_mode = ($encrypt_mode eq "S") ? 1 : 0; # The main copy of the log file ... my $log_file = "./t/test_ccc_new.txt"; # ----------------------------------------------------------- # End of user interaction ... # ----------------------------------------------------------- # This section initializes an unsupported feature to Net::FTPSSL. # Code is left here so that I can easily revisit it in the future if needed. # That's why option SSL_Advanced is commented out below but left uncommented # here. Do not use this feature unless you absolutely have no choice! my %advanced_hash = ( SSL_version => ($encrypt_mode ? "SSLv23" : "TLSv1"), Timeout => 99 ); # ----------------------------------------------------------- my %callback_hash; # Delete test files from previous run unlink ("./t/test_file_new.tar.gz", "./t/FTPSSL.pm_new.tst", $log_file); # So we can save the Debug trace in a file from this test. open (OLDERR, ">&STDERR"); open (STDERR, "> $log_file"); print STDERR "\nNet-FTPSSL Version: " . $Net::FTPSSL::VERSION . "\n\n"; # Leave SSL_Advanced commented out ... Unsupported feature ... my $ftp = Net::FTPSSL->new( $server, Port => $port, Encryption => $mode, DataProtLevel => $data, useSSL => $encrypt_mode, # SSL_Advanced => \%advanced_hash, PreserveTimestamp => 1, Debug => 1, Trace => 1, Croak => 1 ); isa_ok( $ftp, 'Net::FTPSSL', 'Net::FTPSSL object creation' ); ok( $ftp->login ($user, $pass), "Login to $server" ); $dir = $ftp->pwd() unless $dir; ok( $ftp->cwd( $dir ), "Changed the dir to $dir" ); my $pwd = $ftp->pwd(); ok( defined $pwd, "Getting the directory: ($pwd)" ); $dir = $pwd unless (defined $pwd); # Convert relative to absolute path. # Turning off croak now that our environment is correct! $ftp->set_croak (0); ok( $ftp->noop(), "Noop test" ); ok( $ftp->binary (), 'putting FTP in binry mode' ); ok( $ftp->put( './t/test_file.tar.gz' ), "puting a test binary file on $dir" ); my @lst = $ftp->list (); ok( scalar @lst != 0, 'list() command' ); print_result (\@lst); # ----------------------------------------------- # Now check out the CCC command ... # ----------------------------------------------- ok( $ftp->ccc (), "The CCC command" ); print STDERR "CCC Command completed!\n"; ok( $ftp->pwd (), "The PWD command" ); @lst = $ftp->list (); ok( scalar @lst != 0, 'list() command' ); print_result (\@lst); ok( $ftp->binary (), 'putting FTP back in binary mode' ); ok( $ftp->delete( 'test_file.tar.gz' ), "deleting the test bin file on $server" ); # ----------------------------------------- # End put/get/rename/delete section ... # ----------------------------------------- $ftp->quit(); # Restore STDERR now that the tests are done! open (STDERR, ">&OLDERR"); if (1 == 2) { print OLDERR "\n"; # Perl gives warning if not present! (Not executed) } } sub ask { my $question = shift; diag("\n$question ? "); my $answer = <STDIN>; chomp $answer; return $answer; } sub ask_yesno { my $question = shift; diag("\n$question ? [y/N]"); my $answer = <STDIN>; chomp $answer; return $answer =~ /^y(es)*$/i ? 1 : 0; } # Save the results from the list() & nlst() calls. # Remember that STDERR should be redirected to a log file by now. sub print_result { my $lst = shift; # Tell the max number of entries you may print out. # Just in case the list is huge! my $cnt = 5; my $max = scalar (@{$lst}); print STDERR "------------- Found $max file(s) -----------------\n"; foreach (@{$lst}) { if ($cnt <= 0) { print STDERR "...\n"; print STDERR "($lst->[-1])\n"; last; } print STDERR "($_)\n"; --$cnt; } print STDERR "-----------------------------------------------\n"; } # Testing out the call back functionality of v0.07 on ... sub callback_func { my $ftps_function_name = shift; my $data_ref = shift; # The data to/from the data channel. my $data_len_ref = shift; # The size of the data buffer. my $total_len = shift; # The number of bytes to date. my $callback_data_ref = shift; # The callback work space. if ( $ftps_function_name =~ m/:list$/ ) { ${$data_ref} =~ s/[a-z]/\U$&/g; # Convert to upper case! # Reformat #'s Ex: 1234567 into 1,234,567. while ( ${$data_ref} =~ s/(\d)(\d{3}\D)/$1,$2/ ) { } ${$data_len_ref} = length (${$data_ref}); # May have changed data length! } elsif ( $ftps_function_name =~ m/:nlst$/ ) { ${$data_ref} =~ s/[a-z]/\U$&/g; # Convert to upper case! ${$data_ref} =~ s/^/[0]: /gm; # Add a prefix per line. # Make the prefix unique per line ... my $cnt = ++$callback_data_ref->{counter}; while ( ${$data_ref} =~ s/\[0\]/[$cnt]/) { $cnt = ++$callback_data_ref->{counter}; } # Fix so counter is correct for next time called! --$callback_data_ref->{counter}; ${$data_len_ref} = length (${$data_ref}); # Changed length of data! } else { print STDERR " *** Unexpected callback for $ftps_function_name! ***\n"; } return (); } # Testing out the end call back functionality of v0.07 on ... sub end_callback_func { my $ftps_function_name = shift; my $total_len = shift; # The total number of bytes sent out my $callback_data_ref = shift; # The callback work space. my $tail; # Additional data channel data to provide ... if ( $ftps_function_name =~ m/:nlst$/ ) { my $cnt; my $sep = ""; $tail = ""; foreach ("Junker", "T-Bird", "Coup", "Model-T", "Horse & Buggy") { $cnt = ++$callback_data_ref->{counter}; $tail .= $sep . "[$cnt]: $_!"; $sep = "\n"; } # So the next nlst call will start counting all over again! delete ($callback_data_ref->{counter}); } return ( $tail ); } # vim:ft=perl:
Hi TJ, I was finally able to upgrade my IO::Socket::SSL from v1.18 to v1.26 and your patch still hangs on the call to stop_SSL() when run against my local FTPS servers. (you were at v1.24) But I don't have a proftpd FTPS server to test against, so I haven't been able to reproduce your success with your patch. I have a couple more things to try out, but it's begining to look like I'll have to do an ugly solution to support you. That it might be a case where different servers behave differently for the ccc() command. So I'm currently considering adding a boolean flag to ccc() or fix it to accept a hash so that any options can be overiden for stop_SSL(). But I need to look at stop_SSL()in IO:Socket::SSL a bit more closely to see if the hash solution makes any sense. I'll keep you informed if I make any progress with your patch. Also the ccc() test will be in 10-complex.t in the next release, v0.11. Curtis
Subject: Re: [rt.cpan.org #47659] Net-FTPSSL-0.09 ccc() does not perform bidirection SSL shutdown
Date: Tue, 14 Jul 2009 08:41:37 -0700 (PDT)
To: Curtis Leach via RT <bug-Net-FTPSSL [...] rt.cpan.org>
From: TJ Saunders <tj [...] castaglia.org>
Show quoted text
> I was finally able to upgrade my IO::Socket::SSL from v1.18 to v1.26 > and your patch still hangs on the call to stop_SSL() when run against > my local FTPS servers. (you were at v1.24) But I don't have a proftpd > FTPS server to test against, so I haven't been able to reproduce your > success with your patch.
I was out of town for the past few days; you can contact me outside of RT for info for a temporary ProFTPD FTPS account that I will setup. What FTP server are you using locally, for testing Net::FTPSSL's CCC functionality? Show quoted text
> I'll have to do an ugly solution to support you. That it might be a > case where different servers behave differently for the ccc() command.
I'm almost certain this is the case. There are not many applications that shut down the SSL session on a TCP connection and yet keep the TCP connection up and use it afterwards; this means there are not many examples for how to do a proper bi-directional SSL session shutdown, on both client and server sides. Show quoted text
> So I'm currently considering adding a boolean flag to ccc() or fix it > to accept a hash so that any options can be overiden for stop_SSL(). > But I need to look at stop_SSL()in IO:Socket::SSL a bit more closely > to see if the hash solution makes any sense.
Do you know where the hang is occurring? My initial unsubstantiated guess is that something (perhaps in the client?) is eventually calling SSL_read(), which is expecting an SSL message, and not seeing it... Cheers, TJ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Words are also actions, and actions are a kind of words. -Ralph Waldo Emerson ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Subject: RE: [rt.cpan.org #47659] Net-FTPSSL-0.09 ccc() does not perform bidirection SSL shutdown
Date: Tue, 14 Jul 2009 14:00:17 -0500
To: bug-Net-FTPSSL [...] rt.cpan.org
From: "Curtis Leach" <cleach [...] harrahs.com>
Hopefully this won't post cleach@cpan.org And no I haven't had the chance to drill down into the IO-Socket-SSL code to see where it's hanging. Curtis Show quoted text
-----Original Message----- From: TJ Saunders via RT [mailto:bug-Net-FTPSSL@rt.cpan.org] Sent: Tuesday, July 14, 2009 10:42 AM Subject: Re: [rt.cpan.org #47659] Net-FTPSSL-0.09 ccc() does not perform bidirection SSL shutdown Queue: Net-FTPSSL Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=47659 >
> I was finally able to upgrade my IO::Socket::SSL from v1.18 to v1.26 > and your patch still hangs on the call to stop_SSL() when run against > my local FTPS servers. (you were at v1.24) But I don't have a proftpd
> FTPS server to test against, so I haven't been able to reproduce your > success with your patch.
I was out of town for the past few days; you can contact me outside of RT for info for a temporary ProFTPD FTPS account that I will setup. What FTP server are you using locally, for testing Net::FTPSSL's CCC functionality?
> I'll have to do an ugly solution to support you. That it might be a > case where different servers behave differently for the ccc() command.
I'm almost certain this is the case. There are not many applications that shut down the SSL session on a TCP connection and yet keep the TCP connection up and use it afterwards; this means there are not many examples for how to do a proper bi-directional SSL session shutdown, on both client and server sides.
> So I'm currently considering adding a boolean flag to ccc() or fix it > to accept a hash so that any options can be overiden for stop_SSL(). > But I need to look at stop_SSL()in IO:Socket::SSL a bit more closely > to see if the hash solution makes any sense.
Do you know where the hang is occurring? My initial unsubstantiated guess is that something (perhaps in the client?) is eventually calling SSL_read(), which is expecting an SSL message, and not seeing it... Cheers, TJ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ Words are also actions, and actions are a kind of words. -Ralph Waldo Emerson ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~
Try cleach@cpan.org, it should reach me outside this chain. Curtis
TJ, Thanks for your help off line. This is to let you know that the patch has been applied to v0.11 Curtis