mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #2988 from hardillb/ALPNProtocols
Add ALPN support to TLS node
This commit is contained in:
commit
8a63390464
@ -67,6 +67,10 @@
|
|||||||
<label style="width: 120px;" for="node-config-input-servername"><i class="fa fa-server"></i> <span data-i18n="tls.label.servername"></span></label>
|
<label style="width: 120px;" for="node-config-input-servername"><i class="fa fa-server"></i> <span data-i18n="tls.label.servername"></span></label>
|
||||||
<input style="width: calc(100% - 170px);" type="text" id="node-config-input-servername" data-i18n="[placeholder]tls.placeholder.servername">
|
<input style="width: calc(100% - 170px);" type="text" id="node-config-input-servername" data-i18n="[placeholder]tls.placeholder.servername">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<label style="width: 120px;" for="node-config-input-alpnprotocol"><i class="fa fa-cogs"></i> <span data-i18n="tls.label.alpnprotocol"></span></label>
|
||||||
|
<input style="width: calc(100% - 170px);" type="text" id="node-config-input-alpnprotocol" data-i18n="[placeholder]tls.placeholder.alpnprotocol">
|
||||||
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label style="width: 120px;" for="node-config-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
<label style="width: 120px;" for="node-config-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
||||||
@ -98,7 +102,8 @@
|
|||||||
keyname: {value:""},
|
keyname: {value:""},
|
||||||
caname: {value:""},
|
caname: {value:""},
|
||||||
servername: {value:""},
|
servername: {value:""},
|
||||||
verifyservercert: {value: true}
|
verifyservercert: {value: true},
|
||||||
|
alpnprotocol: {value: ""}
|
||||||
},
|
},
|
||||||
credentials: {
|
credentials: {
|
||||||
certdata: {type:"text"},
|
certdata: {type:"text"},
|
||||||
|
@ -26,6 +26,7 @@ module.exports = function(RED) {
|
|||||||
var keyPath = n.key.trim();
|
var keyPath = n.key.trim();
|
||||||
var caPath = n.ca.trim();
|
var caPath = n.ca.trim();
|
||||||
this.servername = (n.servername||"").trim();
|
this.servername = (n.servername||"").trim();
|
||||||
|
this.alpnprotocol = (n.alpnprotocol||"").trim();
|
||||||
|
|
||||||
if ((certPath.length > 0) || (keyPath.length > 0) || (caPath.length > 0)) {
|
if ((certPath.length > 0) || (keyPath.length > 0) || (caPath.length > 0)) {
|
||||||
|
|
||||||
@ -106,6 +107,9 @@ module.exports = function(RED) {
|
|||||||
if (this.servername) {
|
if (this.servername) {
|
||||||
opts.servername = this.servername;
|
opts.servername = this.servername;
|
||||||
}
|
}
|
||||||
|
if (this.alpnprotocol) {
|
||||||
|
opts.ALPNProtocols = [this.alpnprotocol];
|
||||||
|
}
|
||||||
opts.rejectUnauthorized = this.verifyservercert;
|
opts.rejectUnauthorized = this.verifyservercert;
|
||||||
}
|
}
|
||||||
return opts;
|
return opts;
|
||||||
|
@ -170,14 +170,16 @@
|
|||||||
"passphrase": "Passphrase",
|
"passphrase": "Passphrase",
|
||||||
"ca": "CA Certificate",
|
"ca": "CA Certificate",
|
||||||
"verify-server-cert":"Verify server certificate",
|
"verify-server-cert":"Verify server certificate",
|
||||||
"servername": "Server Name"
|
"servername": "Server Name",
|
||||||
|
"alpnprotocol": "ALPN Protocol"
|
||||||
},
|
},
|
||||||
"placeholder": {
|
"placeholder": {
|
||||||
"cert":"path to certificate (PEM format)",
|
"cert":"path to certificate (PEM format)",
|
||||||
"key":"path to private key (PEM format)",
|
"key":"path to private key (PEM format)",
|
||||||
"ca":"path to CA certificate (PEM format)",
|
"ca":"path to CA certificate (PEM format)",
|
||||||
"passphrase":"private key passphrase (optional)",
|
"passphrase":"private key passphrase (optional)",
|
||||||
"servername":"for use with SNI"
|
"servername":"for use with SNI",
|
||||||
|
"alpnprotocol":"for use with ALPN"
|
||||||
},
|
},
|
||||||
"error": {
|
"error": {
|
||||||
"missing-file": "No certificate/key file provided"
|
"missing-file": "No certificate/key file provided"
|
||||||
|
Loading…
Reference in New Issue
Block a user