Remote-ftp: TLS FTP connection and Self Signed Certificate

Created on 18 Mar 2015  路  5Comments  路  Source: icetee/remote-ftp

Is there any way to connect to a FTP over TLS ?

documentation

Most helpful comment

Now it works !
I used this configuration for FTPS (explicit TLS, self-signed certificate) :

{
"protocol": "ftp",
"host": "domain.com",
"port": 21,
"user": "myUser",
"pass": mySecretPassword",
"remote": "/",
"secure": true,
"secureOptions": {"rejectUnauthorized":false},
"connTimeout": 10000,
"pasvTimeout": 10000,
"keepalive": 10000
}

All 5 comments

So I could get a little bit further thanks to this issue https://github.com/mgrenier/remote-ftp/issues/7

my .ftpconfig file:

{
"protocol": "ftp",
"host": "server_example.com",
"port": 21,
"user": "username",
"pass": "password",
"remote": "/",
"secure": true,
"secureOptions": null,
"connTimeout": 10000,
"pasvTimeout": 10000,
"keepalive": 10000
}

but I get Remote FTP: Error: self signed certificate

Hello,

I have the same problem : my connection is refused because "Remote FTP: Error: self signed certificate".

It seems we need to add a secureOptions : i've found a page describing these options (https://nodejs.org/api/tls.html#tls_tls_connect_options_callback, found via https://discuss.atom.io/t/remote-ftp-ftps-package/10821/5)

An option catch my attention :
"rejectUnauthorized: If true, the server certificate is verified against the list of supplied CAs. An 'error' event is emitted if verification fails; err.code contains the OpenSSL error code. Default: true."
So I tried to edit my .ftpconfig file with :

"secureOptions": "rejectUnauthorized:false",

but it doesn't change anything, I still got the same error "Remote FTP: Error: self signed certificate".

I found on issue #7 the following :
"secureOptions": null, // object - Additional options to be passed to tls.connect(). Default: (null) see http://nodejs.org/api/tls.html#tls_tls_connect_options_callback

other options in the config file are of type string, or integer, we have here a type object.
How can I pass a "object" type with this json config file ?

I'm almost sure that I need to set rejectUnauthorized to false in tls.connect()... but I don't know how to do it :(

Now it works !
I used this configuration for FTPS (explicit TLS, self-signed certificate) :

{
"protocol": "ftp",
"host": "domain.com",
"port": 21,
"user": "myUser",
"pass": mySecretPassword",
"remote": "/",
"secure": true,
"secureOptions": {"rejectUnauthorized":false},
"connTimeout": 10000,
"pasvTimeout": 10000,
"keepalive": 10000
}

{"rejectUnauthorized":false}
this needs to be on the Wiki / readme! it helped me!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthew-e-brown picture matthew-e-brown  路  6Comments

JamesCoyle picture JamesCoyle  路  7Comments

peterbode1989 picture peterbode1989  路  3Comments

abvincita picture abvincita  路  7Comments

milesbarry picture milesbarry  路  3Comments