FluentFTP icon indicating copy to clipboard operation
FluentFTP copied to clipboard

Unable to get directories (or files) with GetListing

Open CurbeNL opened this issue 7 years ago • 11 comments

I'm unable to get the directories (or even files) with GetListing:

                FtpClient ftpConn = new FtpClient();
                ftpConn.Host = FtpServer;
                ftpConn.Port = FtpPort;
                ftpConn.Credentials = new System.Net.NetworkCredential(Username, Password);
                ftpConn.SslProtocols = System.Security.Authentication.SslProtocols.Tls12;
                ftpConn.EncryptionMode = FtpEncryptionMode.Implicit;
                ftpConn.ValidateCertificate += new FtpSslValidation(Client_ValidateCertificate);
                ftpConn.BulkListing = false;
                //ftpConn.DataConnectionType = FtpDataConnectionType.AutoPassive;
                ftpConn.Connect();

                FtpListItem[] FtpFolders = null;

                FtpFolders = ftpConn.GetListing(Folder);

I'm using the latest version. Any suggestions?

CurbeNL avatar Nov 14 '19 01:11 CurbeNL

Same here. GetListing returns "Authentication failed because remote party has closed the transport stream" while downloading file using FTPS.

Problem starts from the past month, maybe a Windows Update about TLS is blocking the communication ?

Fadelast avatar Nov 14 '19 10:11 Fadelast

Not sure, too many issues could be at play here...

robinrodricks avatar Nov 18 '19 11:11 robinrodricks

We have moved temporarily to WinSCP. We made no modification to the code what so ever. But I asume it's a Windows update because it still works on the production environment, but not on our development. Production is behind on updates.

CurbeNL avatar Nov 21 '19 15:11 CurbeNL

I have the same problem. Any suggestions? With Filezilla I can connect without any problems.

JanLorenz77 avatar Dec 05 '19 11:12 JanLorenz77

I have the same problem. Any suggestions? With Filezilla I can connect without any problems.

We also solved using the net assembly of winscp https://winscp.net/eng/docs/library

It support FTPS even if in the documentation is'nt specified.

Fadelast avatar Dec 05 '19 11:12 Fadelast

Try AutoDetect() to discover the best connection settings and see if it works then.

See https://github.com/robinrodricks/FluentFTP#faq_autodetect

robinrodricks avatar Jan 21 '20 05:01 robinrodricks

The connect works, but unfortunately I now get another error with GetListing(..):

FluentFTP.FtpCommandException HResult=0x80131500 Nachricht = Unable to build data connection: Operation not permitted Quelle = FluentFTP Stapelüberwachung: bei FluentFTP.FtpClient.GetListingInternal(String listcmd, FtpListOption options, Boolean retry) bei FluentFTP.FtpClient.GetListing(String path, FtpListOption options) bei Dennree.Bibliothek.Net.RetryFtpClient.<>c__DisplayClass25_0.b__0()

Is there an alternative to Getlisting()?

Filezilla has no problems with my test server.

JanLorenz77 avatar Jan 21 '20 07:01 JanLorenz77

Our ftp server provider has made a change to the SSL configuration. Now it's working.

JanLorenz77 avatar Jan 21 '20 11:01 JanLorenz77

@JanLorenz77 What was the change?

robinrodricks avatar Jan 22 '20 05:01 robinrodricks

My service provider said that he added the "TLSOptions NoSessionReuseRequired" option to the server configuration and restarted the service.

JanLorenz77 avatar Jan 22 '20 06:01 JanLorenz77

@JanLorenz77 Thanks - https://github.com/robinrodricks/FluentFTP/issues/514

robinrodricks avatar Jan 28 '20 05:01 robinrodricks