morris / vinyl-ftp

Blazing fast vinyl adapter for FTP
Other
388 stars 31 forks source link

rejectUnauthorized ignored? #128

Open xenogenesi opened 4 years ago

xenogenesi commented 4 years ago

I'm using ProFTPD with tls support and a private certificate (tested with Firezilla and lftp), I'm setting the secure option and the secureOptions like below:

export function deployClean(cb) {
    var conn = ftp.create({
        host:     'localhost',
        user:     'ftpuser',
        password: 'password',
        //parallel: 10,
        //maxConnections: 10, // >= parallel
        log:      gutil.log,
        secure: true,
        secureOtions: { rejectUnauthorized: false },
    });

but I'm getting this error:

[19:39:48] Requiring external module esm
[19:39:49] Using gulpfile ~/jsapp/gulpfile.esm.js
[19:39:49] Starting 'deploy'...
[19:39:49] CONN 
[19:39:49] ERROR Error: self signed certificate
    at TLSSocket.onConnectSecure (_tls_wrap.js:1321:34)
    at TLSSocket.emit (events.js:223:5)
    at TLSSocket.EventEmitter.emit (domain.js:498:23)
    at TLSSocket._finishInit (_tls_wrap.js:794:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:608:12) (DEPTH_ZERO_SELF_SIGNED_CERT)
[19:39:49] DISC 
[19:39:49] 'deploy' errored after 139 ms
[19:39:49] Error: self signed certificate
    at TLSSocket.onConnectSecure (_tls_wrap.js:1321:34)
    at TLSSocket.emit (events.js:223:5)
    at TLSSocket.EventEmitter.emit (domain.js:498:23)
    at TLSSocket._finishInit (_tls_wrap.js:794:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:608:12)

I'm using the environment version as a workaround (but I would prefer to use the configuration)

NODE_TLS_REJECT_UNAUTHORIZED=0 gulp deploy

node version v12.14.1