How to connect to a implicit FTPS server with nodeJS?

扶醉桌前 提交于 2019-12-12 16:02:15

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/41221050/how-to-connect-to-a-implicit-ftps-server-with-nodejs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!