mirror of https://github.com/node-red/node-red.git
Fixup tls config for tests
parent
214fbc0e47
commit
71440be009
|
@ -22,15 +22,16 @@ module.exports = function(RED) {
|
|||
RED.nodes.createNode(this,n);
|
||||
this.valid = true;
|
||||
this.verifyservercert = n.verifyservercert;
|
||||
var certPath = n.cert.trim();
|
||||
var keyPath = n.key.trim();
|
||||
var caPath = n.ca.trim();
|
||||
var p12Path = n.p12.trim();
|
||||
var certPath, keyPath, caPath, p12Path;
|
||||
if (n.cert) { certPath = n.cert.trim(); }
|
||||
if (n.key) { keyPath = n.key.trim(); }
|
||||
if (n.ca) { caPath = n.ca.trim(); }
|
||||
if (n.p12) { p12Path = n.p12.trim(); }
|
||||
this.certType = n.certType || "files";
|
||||
this.servername = (n.servername||"").trim();
|
||||
this.alpnprotocol = (n.alpnprotocol||"").trim();
|
||||
|
||||
if ((certPath.length > 0) || (keyPath.length > 0) || (caPath.length > 0)) {
|
||||
if ((certPath && certPath.length > 0) || (keyPath && keyPath.length > 0) || (caPath && caPath.length > 0)) {
|
||||
|
||||
if ( (certPath.length > 0) !== (keyPath.length > 0)) {
|
||||
this.valid = false;
|
||||
|
@ -55,7 +56,7 @@ module.exports = function(RED) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
else if (p12Path.length > 0) {
|
||||
else if (p12Path && p12Path.length > 0) {
|
||||
try {
|
||||
this.pfx = fs.readFileSync(p12Path);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
File message line 1
|
||||
File message line 2
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"instanceId": "bff8dba3f474d406",
|
||||
"_credentialSecret": "c9ca84d93a4f6236426cc740b147b50f32b3dd9aab9f4191390a604197722a4d"
|
||||
}
|
Loading…
Reference in New Issue