in reply to Re: NET:FTPSSL, 555 Can't read command channel socket
in thread NET:FTPSSL, 555 Can't read command channel socket

Seems reasonable and thanks for pointing out, where the error on the module appears.
The recipient's ftp server seems to throw the HELP command as the reply to entering into PASV.
I compared the output from the same script, which runs OK on old server, and on new server

OLD server

>>> TYPE I <<< 200 Type set to I >>> PBSZ 0 <<< 200 PBSZ Command successful. >>> PROT P <<< 200 PROT Command successful. >>> PASV <<< 227 Entering Passive Mode (XXX,XXX,XXX,XXX,23,237) >>> ALLO 5 <<< 202 ALLO command ignored. >>> STOR test <<< 150 Opening data connection for test. <<< 226 Transfer complete. >>> QUIT <<< 221 Goodbye.

NEW server

>>> TYPE I <<< 200 Type set to I >>> PBSZ 0 <<< 200 PBSZ Command successful. >>> PROT P <<< 200 PROT Command successful. >>> PASV <<< 227 Entering Passive Mode (XXX,XXX,XXX,XXX,23,243) >>> HELP <<< 214- The following commands are recognized (* =>'s unimplemented). <<< USER PORT STOR MSAM* RNTO NLST MKD CDUP <<< PASS PASV APPE MRSQ* ABOR* SITE XMKD* XCUP* <<< ACCT* TYPE MLFL* MRCP* DELE SYST RMD STOU <<< SMNT* STRU MAIL* ALLO CWD STAT XRMD* SIZE <<< REIN MODE MSND* REST* XCWD* HELP PWD MDTM* <<< QUIT RETR MSOM* RNFR LIST NOOP XPWD* FEAT <<< AUTH PBSZ PROT CCC <<< 214 Direct comments to sysadm. <<+ 214 The ALLO command is supported. >>> ALLO 5 <<< 202 ALLO command ignored. >>> STOR test <<+ 555 Can't read command channel socket: >>> QUIT <<+ 555 Can't read command channel socket:
The further attempts to reveal the truth lead me to the strace output:
open("test", O_RDONLY) = 4 ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff91df0b70) = -1 ENOTTY (I +nappropriate ioctl for device) lseek(4, 0, SEEK_CUR) = 0 fstat(4, {st_mode=S_IFREG|0777, st_size=5, ...}) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 write(2, ">>> PBSZ 0\n", 11>>> PBSZ 0 ) = 11 write(3, "\27\3\1\0\30Y\334L\2637>O\211\225C\313vG\302\233\311/\354\34 +\n\375\26JH", 29) = 29 read(3, "\27\3\1\0.", 5) = 5 read(3, "|\3\256\307\305\26\3N\177\270\255\333\323\365a,\350\n9\234&\3 +52\274\316\320{\2264\301y\204\321"..., 46) = 46 write(2, "<<< 200 PBSZ Command successful."..., 33<<< 200 PBSZ Command + successful. ) = 33 write(2, ">>> PROT P\n", 11>>> PROT P ) = 11 write(3, "\27\3\1\0\30<\203,c\325/\26\211\27*\246Q6\313,F\301\251\247l +\327\227T\236", 29) = 29 read(3, "\27\3\1\0.", 5) = 5 read(3, "\316>\361\207&%\350\351z\301R\234Z\227k\257\370<k9E\267P\225\ +r\300R\6\331\374\273\227"..., 46) = 46 write(2, "<<< 200 PROT Command successful."..., 33<<< 200 PROT Command + successful. ) = 33 write(2, ">>> PASV\n", 9>>> PASV ) = 9 write(3, "\27\3\1\0\26\207\31Pp!\301R\17\31\2600\275\203\326\34\233Z\2 +1\225|\r|", 27) = 27 read(3, "\27\3\1\0A", 5) = 5 read(3, "\263+\7(\272Fi\322\356\24 ;i\246\213\374\253\346\206\23\n'\24 +4\366c\222\306wkCF\301"..., 65) = 65 write(2, "<<< 227 Entering Passive Mode (1"..., 52<<< 227 Entering Pas +sive Mode (XXX,XXX,XXX,XXX,23,212) ) = 52 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 5 ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff91df0d60) = -1 EINVAL (I +nvalid argument) lseek(5, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek) ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff91df0d60) = -1 EINVAL (I +nvalid argument) lseek(5, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek) fcntl(5, F_SETFD, FD_CLOEXEC) = 0 connect(5, {sa_family=AF_INET, sin_port=htons(6100), sin_addr=inet_add +r("XXX.XXX.XXX.XXX")}, 16) = 0 stat("test", {st_mode=S_IFREG|0777, st_size=5, ...}) = 0 stat("test", {st_mode=S_IFREG|0777, st_size=5, ...}) = 0
What do you think, is it failing to open the file 'test'? and this fails the "command channel"?

Replies are listed 'Best First'.
Re^3: NET:FTPSSL, 555 Can't read command channel socket
by ayegorov (Initiate) on Jan 06, 2011 at 18:28 UTC
    At this point the issue was resolved by using 0.04 Net::FTPSSL
      I was getting the same error message using 0.17 of Net::FTPSSL but works fine with 0.11. Fortunately, I had 0.11 on another machine. Problem specific to 0.17 I wonder?

      I worked around it in 0.17 by setting OverrideHELP to 1.

      "OverrideHELP - Some FTPS servers on encrypted connections incorrctly send back part of the response to the HELP command in clear text instead of it all being encryped, breaking the command channel connection. This class calls HELP internally via supported() for some conditional logic, making a work around necessary to be able to talk to such servers."

      "This option supports three distinct modes to support your needs. You can pass a reference to an array that lists all the FTP commands your sever supports, you can set it to 1 to say all commands are supported, or set it to 0 to say none of the commands are supported. See supported() for more details."