# Ftps with self signed certificate

**URL:** https://discourse.nodered.org/t/ftps-with-self-signed-certificate/97939
**Category:** General
**Tags:** docker
**Created:** [3 July 2025 15:33 UTC](https://discourse.nodered.org/t/ftps-with-self-signed-certificate/97939 "2025-07-03T15:33:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![remsfn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/remsfn/32/101823_2.png) [@remsfn](https://discourse.nodered.org/u/remsfn)
#### Post date: [3 July 2025 15:33 UTC](https://discourse.nodered.org/t/ftps-with-self-signed-certificate/97939/1 "2025-07-03T15:33:55Z")

</div>

Hi,  
i am using nodered-contrib-ftp-client to send files to ftps server.  
This server use selfsigned certificate.  
This is returning an 'Error: self-signed certificate".  
how to solve that ?  
Here is a test exemple:

```auto
[
    {
        "id": "e2299cfa34e269e6",
        "type": "debug",
        "z": "c6ca1cc93c0319f7",
        "name": "debug 8",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 460,
        "y": 320,
        "wires": []
    },
    {
        "id": "ca893cd7bfc18d6c",
        "type": "inject",
        "z": "c6ca1cc93c0319f7",
        "name": "",
        "props": [
            {
                "p": "operation",
                "v": "LIST",
                "vt": "str"
            },
            {
                "p": "host",
                "v": "docker",
                "vt": "str"
            },
            {
                "p": "port",
                "v": "21",
                "vt": "num"
            },
            {
                "p": "secure",
                "v": "explicit",
                "vt": "str"
            },
            {
                "p": "user",
                "v": "user",
                "vt": "str"
            },
            {
                "p": "password",
                "v": "123456",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 130,
        "y": 320,
        "wires": [
            [
                "b4875d4a96269eb0"
            ]
        ]
    },
    {
        "id": "b4875d4a96269eb0",
        "type": "ftp",
        "z": "c6ca1cc93c0319f7",
        "name": "",
        "x": 290,
        "y": 320,
        "wires": [
            [
                "e2299cfa34e269e6"
            ]
        ]
    }
]

```

---

<div class="post-metadata">

### Author: ![kitori](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@kitori](https://discourse.nodered.org/u/kitori)
#### Post date: [4 July 2025 08:28 UTC](https://discourse.nodered.org/t/ftps-with-self-signed-certificate/97939/2 "2025-07-04T08:28:08Z")

</div>

You can try using the msg.secureOptions and set the ca to the cert present by the ftp server.  
I dont't now how this work, but [here](https://nodejs.org/api/tls.html#tlscreatesecurecontextoptions) it is mentioned that it can be a string

```auto
msg.secureOptions = {
   ca: <<PEM String>>)
};

```

node-red:

> **[node-red-contrib-ftp-client](https://www.npmjs.com/package/node-red-contrib-ftp-client?activeTab=code)**
>
> FTP client node for Node-RED.. Latest version: 0.1.11, last published: 2 years ago. Start using node-red-contrib-ftp-client in your project by running \`npm i node-red-contrib-ftp-client\`. There are no other projects in the npm registry using...

Here is the init of the tls connection of the node-ftp package:

> <https://github.com/mscdex/node-ftp/blob/7dff82fc049a52f51803bdffb95ec1de383f9fac/lib/connection.js#L145>

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [2 October 2025 08:28 UTC](https://discourse.nodered.org/t/ftps-with-self-signed-certificate/97939/3 "2025-10-02T08:28:58Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
