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

TSL | LIST command returns No connection established #333

Open
DenisLevkovets opened this issue Jul 14, 2022 · 8 comments
Open

TSL | LIST command returns No connection established #333

DenisLevkovets opened this issue Jul 14, 2022 · 8 comments

Comments

@DenisLevkovets
Copy link

DenisLevkovets commented Jul 14, 2022

Node version: 12.22.12
ftp-srv version: 4.6.2
FTP client: CyberDuck

Hi everyone!
I went throw a lot of opened and closed issues, but cannot solve one problem. The explicit ftp connection doesn't work either local or docker environment. The ftp server config is followed:

const FtpServer = new FtpSrv({
url: ftp://0.0.0.0:21,
pasv_url: 0.0.0.0,
pasv_min: 65500,
pasv_max: 65505,
anonymous: false,
tls: {
key: fs.readFileSync(${__dirname}/certs/server-key.pem),
cert: fs.readFileSync(${__dirname}/certs/server-cert.pem),
ca: [fs.readFileSync(${__dirname}/certs/ca-cert.pem)],
passphrase: 'qwerty'
},
});

It works on FTP protocol, but fails on FTPs.
Error: {"name":"ftp-srv","hostname":"...","pid":83295,"id":"f79f8302-ea3a-4c49-a5b3-a1ca2a13d087","ip":"127.0.0.1","directive":"LIST","level":50,"err":{"message":"operation timed out","name":"TimeoutError","stack":...}}

I started to add console.log statements in code of ftp-srv package and found out that connectionHandler was not called during tls.createServer method. It's common issue to #192 which was no solved.

@trs @matt-forster Any thoughts?

@DenisLevkovets
Copy link
Author

@trs, @matt-forster Additional info. When it comes to execute LIST command I print the connection data and receive followed:

connector: Passive {
connection: FtpConnection {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
server: [FtpServer],
id: 'ce16e4fb-9cbf-4ed9-a4eb-04cbdf29de11',
commandSocket: [TLSSocket],
log: [Logger],
commands: [FtpCommands],
transferType: 'ascii',
encoding: 'utf8',
bufferSize: 0,
_restByteCount: 0,
_secure: true,
connector: [Circular],
username: 'hotel',
authenticated: true,
fs: [FileSystem],
[Symbol(kCapture)]: false
},
dataSocket: null,
....
}
}

Data socket in this case is null, but in simple FTP connection it equals to a normal Socket Object

@matt-forster
Copy link
Contributor

Weird - I am seeing a passive connection object here, and you mentioned you were using explicit?

@DenisLevkovets
Copy link
Author

Yes, as you see the url in server options starts from ftp://

This is explicit connection, right?

@DenisLevkovets
Copy link
Author

Also, I tried to use resolve function from documentation for pasv_url and public-ip package, but it didn't help. The variants with '0.0.0.0', '127.0.0.1' and my own public ip didn't help too. As I understood, connectionHandler should be triggered on 'secureConnection' event, but something prevent this event.

@DenisLevkovets
Copy link
Author

@matt-forster It's more weird, because my configuration is common to other configurations mentioned in closed issues when such problem was solved. Moreover, I clone this repository, launch the start.js file in test directory and get the same error
Снимок экрана 2022-07-14 в 21 34 40

@matt-forster
Copy link
Contributor

It might be a filesystem or permissions issue, the list command is not resolving any value, and the promise is not completing.

@DenisLevkovets
Copy link
Author

It's repeated localy, on VM and inside docker. Few times I was passed throw login and get the list of files(somehow), but upload and download operations were failed

@DenisLevkovets
Copy link
Author

FileZilla connected to my server with explicit TLS connection:)) CyberDuck and Commander One fails.

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

No branches or pull requests

2 participants