3

For a project I have to connect to a FTPS server over a implicit connection. I tried with node-ftp, because it seems that this is the only library, that supports the implicit connection.

I connect using the following code:

var ftpC = new FTPClient();
  ftpC.on('ready', function () {
    console.log('Connection successful!');
  });

  ftpC.on('error', function (err) {
    console.log(err);
  });

  console.log('Try to connect to FTP Server...');
  ftpC.connect({
    host: HOST_TO_CONNECT,
    port: 990,
    secure: 'implicit',
    user: '***',
    password: '***',
    secureOptions: {
      rejectUnauthorized: false
      // secureProtocol: 'SSLv23_method',
      // ciphers: 'ECDHE-RSA-AES128-GCM-SHA256'
    }
  })

This code gives me everytime a timeout error. If I raise the timeout, the error comes later. I tried in secureOptions to add the params rejectUnauthorized, secureProtocol and ciphers, as you can see. None of them is working. Everytime I get this timeout error.

In FileZilla I have no problem to connect. Everything is working fine.

Do someone have a solution for this behavior? Or is there another plugin for nodejs to connect to a implicit FTPS server?

Peter
  • 31
  • 4
  • Do you see anything logged if you add event listeners for the "greeting" `node-ftp` event, or the "secureConnect" `tls` event, _e.g._ `ftpC.on("greeting", function (text) {` or `ftpC.on("secureConnect", function (...)`, for getting more information? – Castaglia Dec 28 '16 at 20:41

1 Answers1

2

This appears to be a bug in node-ftp. I've created a PR for it and will update this as soon as it's been fixed.

Kelly
  • 40,173
  • 4
  • 42
  • 51