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

Cannot use PASV when EPSV was used before. #791

Closed
wasabii opened this issue Mar 7, 2019 · 6 comments
Closed

Cannot use PASV when EPSV was used before. #791

wasabii opened this issue Mar 7, 2019 · 6 comments

Comments

@wasabii
Copy link

wasabii commented Mar 7, 2019

I'm trying to figure out a way to solve this. It seems to be a limit in ProFTPd, that you can't switch from EPSV to PASV. However, I have a client library that tries to use EPSV, and if that fails, switches to PASV on it's own and tries that instead.

Why would changes to this be prevented? Just a limitation?

@Castaglia
Copy link
Member

What're the error/logs that you see, when trying to switch from EPSV to PASV? I can't recall any particular limitations that you should be encountering...

@Castaglia Castaglia self-assigned this Mar 7, 2019
@wasabii
Copy link
Author

wasabii commented Mar 19, 2019

So, found the error. I was using mod_proxy. The error comes from my backend. I forced ProFTPd's mod_proxy to always use PASV, regardless what the client wants, and it's fine now.

@wasabii wasabii closed this as completed Mar 19, 2019
@Castaglia
Copy link
Member

Glad to hear that you found the cause and the fix. Would you be willing to provide some example logs, from the client- and server-side of things, so that I can add those logs as examples, in docs, of symptoms other users might see, and how to address them?

@wasabii
Copy link
Author

wasabii commented Mar 19, 2019

Unfortunately I solved it a week ago, and lost the logs. ;(

The backend server I'm using doesn't support EPSV. It's a .NET library called FubarDev.FtpServer And the client involved was FluentFTP, a .NET FTP client library.

This library, in default operation, attempts to open an EPSV connection, and then when that fails, attempts to move down the list trying different modes.

ProFTPD was passing this all back to the backend. The backend was rejecting the EPSV. And then when the client next tried PASV, it was throwing an error about attempting to switch.

So, to shield all that, I've forced ProFTPd's mod_proxy to always use PASV, through ProxyDataTransferPolicy. This allows the client to connect with whatever it wants (it picks EPSV) but always do PASV to the server. So the server doesn't know any better.

@Castaglia
Copy link
Member

OK, thanks for the info! I'll see if there's a way to make mod_proxy better detect/handle cases where the backend FTP server does not support EPSV, but the frontend client issues an EPSV (or EPRT) command.

Filed this for tracking as Castaglia/proftpd-mod_proxy#146

@wasabii
Copy link
Author

wasabii commented Apr 20, 2019

Oh wow! Thanks! It took me a couple days to work this out, so that might save others the trouble.

You rock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants