[
https://issues.apache.org/jira/browse/NET-666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16780190#comment-16780190
]
Raymond commented on NET-666:
-----------------------------
I also had error 150 when connecting to FileZilla Server over FTPS. I used
Apache Camel as a client which uses Apache Commons Net FTP under the hood. The
reason for the error code was because TLS session reuse.
Short explanation:
1) First a connection and handshake are done by the client over port 21.
2) Secondly the data is send over another port.
FileZilla by default expects that this is done from the same session/handshake.
Commons Net make a new session. It was possible to turn that off in the
FileZilla server TLS configuration. Then it worked. It would be better if
Commons FTP could handle this scenario (or at least give some clear error
message).
For complete information:
http://camel.465427.n5.nabble.com/FTPS-Handshake-error-td5829967.html
> Pure-FTP MLSD Answer is not interpreted correctly
> -------------------------------------------------
>
> Key: NET-666
> URL: https://issues.apache.org/jira/browse/NET-666
> Project: Commons Net
> Issue Type: Bug
> Components: FTP
> Affects Versions: 3.6
> Reporter: Mehmet Can Cömert
> Priority: Major
> Attachments: FileZillaLog.txt, ListFilesLog.txt, ListFilesTester.java
>
>
> Hello,
> For our integration tests, we made an FTPS server setup with Pure-FTP.
> It is running with a self-signed TLS certificate in a docker container.
> With FileZilla, we can make a connection and see files or we can
> upload/download files.
> You can see the complete FileZilla communication logs in the FileZillaLog.txt
> The part related to MLSD is like following:
> -----
> Command: MLSD
> Trace: Trying to resume existing TLS session.
> Trace: TLS Handshake successful
> Trace: TLS Session resumed
> Trace: Protocol: TLS1.2, Key exchange: ECDHE-RSA, Cipher: CHACHA20-POLY1305,
> MAC: AEAD
> Trace: Hostname does not match certificate SANs
> Response: 150 Accepted data connection
> Response: 226-Options: -a -l
> Response: 226 3 matches total
> Listing:
> type=cdir;sizd=30;modify=20190218135100;UNIX.mode=0755;UNIX.uid=1000;UNIX.gid=1000;unique=fd0eg103ba52;
> .
> Listing:
> type=pdir;sizd=40;modify=20190218134929;UNIX.mode=0755;UNIX.uid=1000;UNIX.gid=0;unique=fd0eg81323a;
> ..
> Listing:
> type=file;size=1002;modify=20190218135100;UNIX.mode=0644;UNIX.uid=1000;UNIX.gid=1000;unique=fd0eg103ba53;
> test-file.txt
> Status: Directory listing of "/test" successful
> ----
> With Commons-Net I have written a small test class based on CCCTester
> The test file is available in ListFilesTester.java and complete logs in
> ListFilesLog.txt
> The part related to MLSD is like following:
> ---
> COMMAND: PASV
> REPLY: 227 Entering Passive Mode (192,168,52,185,117,53)
> COMMAND: MLSD
> REPLY: 150 Accepted data connection
> org.apache.commons.net.ftp.FTPConnectionClosedException: Connection closed
> without indication.
> at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:324)
> at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:300)
> at org.apache.commons.net.ftp.FTP.getReply(FTP.java:732)
> at
> org.apache.commons.net.ftp.FTPClient.completePendingCommand(FTPClient.java:1857)
> at
> org.apache.commons.net.ftp.FTPClient.initiateMListParsing(FTPClient.java:3452)
> at org.apache.commons.net.ftp.FTPClient.mlistDir(FTPClient.java:2546)
> at org.apache.commons.net.ftp.FTPClient.mlistDir(FTPClient.java:2533)
> at
> org.apache.commons.net.ftp.parser.ListFilesTester.test(ListFilesTester.java:48)
> at
> org.apache.commons.net.ftp.parser.ListFilesTester.main(ListFilesTester.java:103)
> ---
> Once we debug inside __getReply method we can actually see
> 150 Accepted data connection
> message in "_replyLines" list but it is written in the list of previous
> answer lines.
> Next call to _controlInput_.readLine(); results NULL in the "line" variable
> and exception is thrown.
> This issue seems also very similar to
> https://issues.apache.org/jira/browse/NET-598
> It would be nice to make Pure-FTP working together with Commons-Net.
> It is used in one of the popular Docker Images for FTP Servers and it is
> useful for integration tests.
> Docker Image is available under:
> https://hub.docker.com/r/stilliard/pure-ftpd/
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)