ftps upload file

This forum contains bug reports from previous beta tests - the issue has remained unresolved, either because it couldn't be reproduced, or couldn't be prevented/fixed

Moderators: sheep, Hacker, Stefan2, white

Post Reply
bagrous
New Member
New Member
Posts: 1
Joined: 2010-06-24, 05:47 UTC

ftps upload file

Post by *bagrous » 2010-06-24, 05:49 UTC

i have one predefined ftps server. if i tried to upload a file to ftps server, it uploads to 100 percent and the dialog doesn't disappear and it couldn't continue with other files (stucks on first file).
everything works fine if i downgrade to 7.50a
other predefined classic ftp servers work great in 7.55

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37766
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2010-06-24, 09:38 UTC

Can you send me a log of both the working and hanging transfer to beta at ghisler dot com, please? I don't have any problems uploading to any of the tested ftps servers, so I need your help to find the problem. TC 7.55 should actually handle hanging connections much better than TC 7.50a...
Author of Total Commander
http://www.ghisler.com

Sob
Power Member
Power Member
Posts: 908
Joined: 2005-01-19, 17:33 UTC

Post by *Sob » 2010-06-24, 12:08 UTC

I also found one such (non-public) server. So I asked about the used software and it's this exact version of Serv-U:

http://web.hisoftware.cz/sob/tmp/ServUSetup_9-4-0-0.exe (md5 fada205b3e922f9530781fe914bc5f43)

Just install it next-next-finish style (i.e. don't change anything), create domain and user and that's all. Default ssl certificate is included and enabled. Connect, upload some file and transfer should hang at 100%. Tested on clean XP SP3.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37766
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2010-06-24, 16:26 UTC

I can confirm the bug in Serv-U 9-4-0-0. The error is in the function SSL_shutdown: According to the OpenSSL documentation, programs need to check the reply of SSL_shutdown, and if it's 0, call SSL_shutdown again:
http://www.openssl.org/docs/ssl/SSL_shutdown.html
It is therefore recommended, to check the return value of SSL_shutdown() and call SSL_shutdown() again, if the bidirectional shutdown is not yet complete (return value of the first call is 0). As the shutdown is not specially handled in the SSLv2 protocol, SSL_shutdown() will succeed on the first call.
I have done this in TC 7.55, but apparently Serv-U 9-4-0-0 is not sending the shutdown reply, so TC waits forever for the closing of the connection.

Therefore I will have to revert to the behaviour of TC 7.50a which just sends shutdown and then closes the connection.
Author of Total Commander
http://www.ghisler.com

Sob
Power Member
Power Member
Posts: 908
Joined: 2005-01-19, 17:33 UTC

Post by *Sob » 2010-06-24, 17:09 UTC

The same page says that for TLS it's ok to only call SSL_shutdown() once, if you're going to close the connection. And ftp data connection can't be reused, so why even bother with second call. ;)

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37766
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2010-06-24, 20:58 UTC

I wanted to be sure that the connection was properly closed, so no data was lost in the upload. But apparently this isn't possible with some servers.
Author of Total Commander
http://www.ghisler.com

Sob
Power Member
Power Member
Posts: 908
Joined: 2005-01-19, 17:33 UTC

Post by *Sob » 2010-06-24, 23:12 UTC

It does feel a little better and safer when the other side correctly confirms ssl shutdown, no doubt about that. And it's bug in Serv-U and only in this older version. So maybe keeping the current behavior and just extending SpecialFlags in wcx_ftp.ini to enable the old one would be enough?

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37766
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2010-06-25, 15:42 UTC

For the moment I will revert to the behaviour of TC 7.50 (send shutdown and not wait for reply).
Author of Total Commander
http://www.ghisler.com

Post Reply