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

Getting a directory listing from a FTPS Server hanging on Windows / SChannel #9161

Closed
grafster opened this issue Jul 15, 2022 · 3 comments
Closed

Comments

@grafster
Copy link

grafster commented Jul 15, 2022

I did this

I set up a local ftps server following these instructions.

https://itnext.io/using-a-local-ftps-server-for-testing-6f2d77873bab

And uploaded some files to it (the problem does not occur if there are no files on the server, but it doesn't seem to matter what files you upload)

I build libcurl using vcpkg on windows, and created and ran the attached program to get the file listing from the remote server. It works correctly on Linux but not in Windows, when curl is compiled with schannel as opposed to OpenSSL.

I got similar results from running:-

curl --ssl-reqd -k --insecure ftp://localhost:21/ --user "foo:pass" --verbose

I expected the following

I expected the program to exit after displaying the file listing, but it hangs indefinitely.

curl/libcurl version

libcurl/7.84.0-DEV Schannel zlib/1.2.12

[curl -V output]

operating system

Windows 10 21H2

Source.cpp.txt

@vszakats vszakats added FTP Windows Windows-specific labels Jul 16, 2022
@grafster
Copy link
Author

I've been doing a bit more digging on this one, and it seems that the problem is partly down to the behaviour of the server. With a different FTP server, after getting the directory listing, the next call to "select" returns 1, and somewhere recv_sspi_close_notify is being get set to true. On this ftp server, the "select" call returns 0, and curl seems to keep calling select until it turns to 1, which it never will.

@grafster
Copy link
Author

grafster commented Jul 18, 2022

Edited 25/07/2022:-

The issue does not occur with vsftpd installed from here https://hub.docker.com/r/bfren/ftps

The server it worked on was an example of "Microsoft FTP Service" that I found online.

@jay
Copy link
Member

jay commented Aug 14, 2022

I couldn't get the docker working for this. If you have a step by step way to reproduce without docker I will try that.

jay added a commit to jay/curl that referenced this issue Mar 3, 2024
- Remove "2.12 FTPS with Schannel times out file list operation"

- Remove "7.12 FTPS directory listing hangs on Windows with Schannel"

- Add "7.12 FTPS server compatibility on Windows with Schannel"

This change adds a more generic bug description that explains FTPS with
the latest curl and Schannel is not widely used and may have more bugs
than other TLS backends.

The two removed FTPS Schannel bugs can't be reproduced any longer and
were likely fixed by 24d6c28.

Ref: curl#5284
Ref: curl#9161
Ref: curl#12894

Closes #xxxx
jay added a commit that referenced this issue Mar 6, 2024
- Remove "2.12 FTPS with Schannel times out file list operation"

- Remove "7.12 FTPS directory listing hangs on Windows with Schannel"

- Add "7.12 FTPS server compatibility on Windows with Schannel"

This change adds a more generic bug description that explains FTPS with
the latest curl and Schannel is not widely used and may have more bugs
than other TLS backends.

The two removed FTPS Schannel bugs can't be reproduced any longer and
were likely fixed by 24d6c28.

Ref: #5284
Ref: #9161
Ref: #12894

Closes #13032
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants