FluentFTP icon indicating copy to clipboard operation
FluentFTP copied to clipboard

TransferFileAsync TLS error

Open m4mm0n opened this issue 4 years ago • 4 comments

FTP OS: Linux

FTP Server: glFTPd

Computer OS: Windows 10

FluentFTP Version: Latest

Logs :

This happens when I try to simply FXP 1 file from one server to another, which are both running glFTPd w/TLS v1.3


Response: 435 Failed TLS negotiation on data channel (timeout), disconnected
Response: 435 Failed TLS negotiation on data channel (timeout), disconnected
Response: 435 Failed TLS negotiation on data channel (SSL_accept(): (5) error:00000000:lib(0):func(0):reason(0)), disconnected
Response: 435 Failed TLS negotiation on data channel (SSL_accept(): (5) error:00000000:lib(0):func(0):reason(0)), disconnected

m4mm0n avatar Jan 11 '21 13:01 m4mm0n

The issue can be fixed, but its a hack; you have to edit "FtpClient_FXPConnection.cs" goto line 154, and replace the following "if" command:

			// send PASV command to destination FTP server to get passive port to be used from source FTP server
			if (!(reply = await destinationClient.ExecuteAsync("PASV", token)).Success) {
				throw new FtpCommandException(reply);
			}

With this:

			if(!(reply = await destinationClient.ExecuteAsync("CPSV", token)).Success)
			{
				// send PASV command to destination FTP server to get passive port to be used from source FTP server
				if (!(reply = await destinationClient.ExecuteAsync("PASV", token)).Success) {
					throw new FtpCommandException(reply);
				}
			}	

However, I still think there should be some other way to solve this issue by adding a custom handler for glFTPd or something like it...

m4mm0n avatar Jan 12 '21 21:01 m4mm0n

Sorry for the late response. Just got around to doing this.

I added your fix by default for all servers - I don't see the harm. However I inverted the logic - I try PASV first and then CPSV as a fallback since its less commonly supported.

Could you try this build please:

FluentFTP.35.0.0_BETA8.zip

robinrodricks avatar Aug 29 '21 08:08 robinrodricks

Released.

https://www.nuget.org/packages/FluentFTP/35.0.2

robinrodricks avatar Aug 29 '21 15:08 robinrodricks

Hi @m4mm0n, can you try the latest build from nuget and tell me if it resolves your issue? I need feedback on this please.

robinrodricks avatar Sep 18 '21 13:09 robinrodricks