Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unable to connect using SSL/TLS #54

@drschwabe

Description

@drschwabe

Is anyone else hosting their app over SSL/TLS ?

I have an SSL cert specifically for "ftp.mydomain.com" which is pointed at my application running nodeftp but have had no luck getting it to work.

The output of my error is as follows:

FTPD listening on port 21
Client connected from xx.xx.xxx.xxx
Establishing secure connection...
Secure socket not authorized: [Error: UNABLE_TO_GET_ISSUER_CERT]

I've tried loading the intermediaries into one .pem file as suggested here as well as just passing them individually in the ca array - but to no avail.

Here's the code. In this example my app uses a Comodo PositiveSSL cert.

//For SSL/TLS:
var tlsOptions = {
  key: fs.readFileSync('ftp_mydomain_com.key'),
  cert: fs.readFileSync('ftp_mydomain_com.crt'),
  ca : [
    fs.readFileSync('ftp_mydomain_com.crt'),  
    fs.readFileSync('COMODORSADomainValidationSecureServerCA.crt'),
    fs.readFileSync('COMODORSAAddTrustCA.crt'), 
    fs.readFileSync('AddTrustExternalCARoot.crt')
  ],
  rejectUnauthorized: true
}

var options = {
  tlsOptions: tlsOptions,
  allowUnauthorizedTls: false,
  tlsOnly: true,
  getInitialCwd: function(connection, initialCwdCallback) {
  //and so forth

The user can connect if if you set "allowUnauthorizedTls".
Also, if you disable "tlsOnly" plain FTP works fine too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions