mscdex / node-ftp

An FTP client module for node.js
MIT License
1.13k stars 244 forks source link

routines:ssl_choose_client_version:unsupported #266

Open wbrown766 opened 4 years ago

wbrown766 commented 4 years ago

Hi all, I am trying to get ftps connection local server running FileZilla

At first I was getting no welcome message so I followed #121 but that has only lead me to this problem.

What I have got at the moment. ftp.mydm.co.uk points to my local server via my rooter.

FileZilla setup ftp setup

code

const c = new ftp();
c.on('error', function(err){
    console.log(err);
});
c.on('greeting', function(msg){
    console.log(msg);
});
c.on('close', function(){
    console.log('closed');
});
c.on('end', function(){
    console.log('ended');
});
c.on('ready', function(){
    console.log('ready');
    c.list(function(err, list){
        console.log('listing');
        if(err) return cb(err);
        console.log(list);
        c.end();
    });
});
const key = fs.readFileSync(ftpKeyPath).toString();
const crt = fs.readFileSync(ftpCrtPath).toString();
console.log(key);
console.log(crt);
c.connect({
    host: 'ftp.mydm.co.uk',
    port: 21,
    user: 'test',
    password: 'test',
    secure: true,
    secureOptions: {
        rejectUnauthorized: false,
        key: key,
        cert: crt,
    }
});

returns

-----BEGIN PRIVATE KEY-----
(my key)
-----END PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
(my cert)
-----END CERTIFICATE-----
FileZilla Server version 0.9.41 beta
written by Tim Kosse (Tim.Kosse@gmx.de)
Please visit http://sourceforge.net/projects/filezilla/
cancled
[Error: 20216:error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol:c:\ws\deps\openssl\openssl\ssl\statem\statem_lib.c:1942:
] {
    library: 'SSL routines',
    function: 'ssl_choose_client_version',
    reason: 'unsupported protocol',
    code: 'ERR_SSL_UNSUPPORTED_PROTOCOL'
}
closed

and on the FileZilla interface

(not logged in) (192.168.101.31)> Connected, sending welcome message...
(not logged in) (192.168.101.31)> 220-FileZilla Server version 0.9.41 beta
(not logged in) (192.168.101.31)> 220-written by Tim Kosse (Tim.Kosse@gmx.de)
(not logged in) (192.168.101.31)> 220 Please visit http://sourceforge.net/projects/filezilla/
(not logged in) (192.168.101.31)> AUTH TLS
(not logged in) (192.168.101.31)> 234 Using authentication type TLS

If I change to is secure: true to secure: 'implicit' I get

-----BEGIN PRIVATE KEY-----
(my key)
-----END PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
(my cert)
-----END CERTIFICATE-----
cancled
Error: Timeout while connecting to server
    at Timeout._onTimeout (C:\timelapse\node_modules\ftp\lib\connection.js:304:24)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7)
closed

and nothing on FileZilla interface

any hey would be appreciated