Thanks Nick, I now have:
this.conf = RED.nodes.getNode(config.database);
this.warn(this.conf.server);
this.tls = RED.nodes.getNode(config.tls);
this.warn(this.tls);
this.tls
is null
. It should be at least [object Object] (or at least something with content). I think it's null in this particular case, because config is linked to "createRecords" and does not have field "tls". As mentioned: I have a TLS configuration in "my-server" as it belongs to the "my-server"-definition.
It's similar to the "mqtt"-node: mqtt allows to select/define a "mqtt-broker", that than allows to select/define a "tls-config".
For me it's a "createRecords"-node: it allows to select/define a "my-server", than than allows to select/define a "tls-config".
"tls-config" is logically part of "my-server", like it is to "mqtt-broker". This is why I thought that I simply use this.conf.tls
to fetch the "tls-config". But unfortunate it's not defined.
The TLS field is part of the configuration node of "my-server" and therefore the field is created with -config-. Like this:
<input type="text" id="node-config-input-tls">
(enhancment) I just opened the JSON definition of the flow. The 'my-server' definition looks like this:
{
"id": "e3aabbb8aea8cc4e",
"type": "my-server",
"name": "Test Server",
"server": "localhost",
"port": "1234",
"tls": "d422a1a578db850c"
},
There is a field "tls" pointing to the correct definition:
{
"id": "d422a1a578db850c",
"type": "tls-config",
"name": "Test Certs",
"cert": "",
"key": "",
"ca": "",
"certname": "Client.crt",
"keyname": "Client.key",
"caname": "RootCA.crt",
"servername": "",
"verifyservercert": true,
"alpnprotocol": ""
}
So, how can I get id "d422a1a578db850c" from the "my-server" configuration node, if "tls" returns nothing?