Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileZilla FTPS Upload TLS failure #930

Closed
Fabian-Tech opened this issue Aug 24, 2022 · 2 comments
Closed

FileZilla FTPS Upload TLS failure #930

Fabian-Tech opened this issue Aug 24, 2022 · 2 comments
Labels
bug Incorrect SSL Shutdown Collection: Incorrect SSL Shutdown issues

Comments

@Fabian-Tech
Copy link

FTP OS: Windows 10

FTP Server: FileZilla Server 1.5.1

Computer OS: Windows 10

FluentFTP Version: 39.4.0

Framework: .NET Framework 4.8

When I try to upload a file to a FileZilla Server on my local machine using TLS I get the following error:
425 Error while transfering data: ECONNABORTED - Connection aborted
The file seems to be uploaded correctly, but the FTPStatus is failed.

This is possibly a duplicate / closely related to #771, which is still open but supposedly was fixed.

Code:

            FtpClient client = new FtpClient(url, login, password);
            //TODO: UNSAFE!
            client.ValidateAnyCertificate = true;
            // connect to the server and automatically detect working FTP settings
            client.AutoConnect();
            var response = client.UploadStream(ms, filepath, FtpRemoteExists.Overwrite);

            // disconnect! good bye!
            client.Disconnect();

Logs :

FluentFTP:

# UploadStream("Test/Hello World2.txt", Overwrite, False)

# FileExists("Test/Hello World2.txt")
Command:  PWD
Response: 257 "/" is current directory.
Command:  SIZE /Test/Hello World2.txt
Response: 213 50320

# DeleteFile("Test/Hello World2.txt")
Command:  DELE Test/Hello World2.txt
Response: 250 File deleted successfully.

# OpenWrite("Test/Hello World2.txt", Binary)

# GetFileSize("Test/Hello World2.txt")
Command:  SIZE Test/Hello World2.txt
Response: 550 Couldn't open the file or directory
Command:  TYPE I
Response: 200 Type set to I

# OpenPassiveDataStream(PASV, "STOR Test/Hello World2.txt", 0)
Command:  PASV
Response: 227 Entering Passive Mode (127,0,0,1,25,39)
Status:   Connecting to ***:6439
Command:  STOR Test/Hello World2.txt
Response: 150 Starting data transfer.
Status:   FTPS Authentication Successful
Status:   Time to activate encryption: 0h 0m 0s.  Total Seconds: 0,0029907.
Status:   Disposing FtpSocketStream...
Response: 425 Error while transfering data: ECONNABORTED - Connection aborted
Command:  QUIT
Response: 221 Goodbye.
Status:   Disposing FtpSocketStream...

FileZilla Server:

Info [Type] Message
FTP Session 84 127.0.0.1 anonymous [Command] STOR Test/Hello World2.txt
FTP Session 84 127.0.0.1 anonymous [Response] 150 Starting data transfer.
FTP Session 84 127.0.0.1 anonymous [Trace] tls_layer_impl::continue_handshake()
FTP Session 84 127.0.0.1 anonymous [Trace] tls_layer_impl::continue_handshake()
FTP Session 84 127.0.0.1 anonymous [Trace] TLS Handshake successful
FTP Session 84 127.0.0.1 anonymous [Trace] TLS Session resumed
FTP Session 84 127.0.0.1 anonymous [Trace] Protocol: TLS1.2, Key exchange: ECDHE-X25519, Cipher: AES-256-GCM, MAC: AEAD, ALPN: 
FTP Session 84 127.0.0.1 anonymous [Trace] session::on_socket_event(): source = data, flag = 2, error = 0, state = 2
FTP Session 84 127.0.0.1 anonymous [Error] GnuTLS error -110 in gnutls_record_recv: The TLS connection was non-properly terminated.
FTP Session 84 127.0.0.1 anonymous [Status] Client did not properly shut down TLS connection
FTP Session 84 127.0.0.1 anonymous [Trace] tls_layer_impl::shutdown()
FTP Session 84 127.0.0.1 anonymous [Trace] data_socket_->shutdown() = 126
FTP Session 84 127.0.0.1 anonymous [Response] 425 Error while transfering data: ECONNABORTED - Connection aborted
FTP Session 84 127.0.0.1 anonymous [Command] QUIT
FTP Session 84 127.0.0.1 anonymous [Response] 221 Goodbye.
@FanDjango
Copy link
Collaborator

FanDjango commented Oct 4, 2022

So: I have done the research on this.

You have FluenFTP V39.4.0.

Nearly a month ago PR #944 addressed exactly this problem. Merged into master on September 10.

It came into Nuget Release V41.0.0 on October 2.

#944 explicitely mentions the wrong order of ssl stream shutdown, as seen from a vsftp server. This happened on any server type - and each server type reacts differently to this. Some more lenient and some less so.

If you read #944 and also read the article mentioned therein (this), you will agree it is the same problem as yours.

Ergo - I advise updating to FluentFTP V41.

@FanDjango
Copy link
Collaborator

Please follow this on #996.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect SSL Shutdown Collection: Incorrect SSL Shutdown issues
Projects
None yet
Development

No branches or pull requests

2 participants