diff --git a/src/main.html b/src/main.html
index e474393..9913f4f 100644
--- a/src/main.html
+++ b/src/main.html
@@ -11,6 +11,11 @@
+
+
+
+
+
@@ -48,7 +53,11 @@
tls: {
value: true,
required: true
- }
+ },
+ selfsigned: {
+ value: false,
+ required: true
+ }
},
credentials: {
token: {
diff --git a/src/main.js b/src/main.js
index 6ff0ebf..7e8ad47 100644
--- a/src/main.js
+++ b/src/main.js
@@ -2,6 +2,7 @@ module.exports = (RED) => {
'use strict';
const Influxdb = require('influxdb-v2');
+ const https = require('https');
function InfluxDbV2Node(config) {
RED.nodes.createNode(this, config);
@@ -11,7 +12,12 @@ module.exports = (RED) => {
host: config.host,
port: config.port,
protocol: config.tls ? 'https' : 'http',
- token: this.credentials.token
+ token: this.credentials.token,
+ fetchOptions: {
+ agent: new https.Agent({
+ rejectUnauthorized: !config.selfsigned
+ })
+ }
});
};