From 6ed1645400a9d129aa7e644ed1d23161713da999 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sun, 27 Nov 2022 13:49:15 -0800 Subject: [PATCH] mqtt: rejectUnauthorized: false --- plugins/mqtt/package-lock.json | 4 ++-- plugins/mqtt/package.json | 2 +- plugins/mqtt/src/api/mqtt-device-base.ts | 1 + plugins/mqtt/src/main.ts | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/mqtt/package-lock.json b/plugins/mqtt/package-lock.json index e044f3c63..4d0a8dcc8 100644 --- a/plugins/mqtt/package-lock.json +++ b/plugins/mqtt/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/mqtt", - "version": "0.0.59", + "version": "0.0.60", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/mqtt", - "version": "0.0.59", + "version": "0.0.60", "dependencies": { "@types/node": "^16.6.1", "aedes": "^0.46.1", diff --git a/plugins/mqtt/package.json b/plugins/mqtt/package.json index 9bf40d504..844630e93 100644 --- a/plugins/mqtt/package.json +++ b/plugins/mqtt/package.json @@ -41,5 +41,5 @@ "@scrypted/common": "file:../../common", "@types/nunjucks": "^3.2.0" }, - "version": "0.0.59" + "version": "0.0.60" } diff --git a/plugins/mqtt/src/api/mqtt-device-base.ts b/plugins/mqtt/src/api/mqtt-device-base.ts index 0229d10aa..1ec5ba28f 100644 --- a/plugins/mqtt/src/api/mqtt-device-base.ts +++ b/plugins/mqtt/src/api/mqtt-device-base.ts @@ -57,6 +57,7 @@ export class MqttDeviceBase extends ScriptableDeviceBase implements Settings { urlWithoutPath.pathname = ''; const client = this.client = connect(urlWithoutPath.toString(), { + rejectUnauthorized: false, username: this.storage.getItem('username') || undefined, password: this.storage.getItem('password') || undefined, }); diff --git a/plugins/mqtt/src/main.ts b/plugins/mqtt/src/main.ts index e1405aa05..860d80359 100644 --- a/plugins/mqtt/src/main.ts +++ b/plugins/mqtt/src/main.ts @@ -257,6 +257,7 @@ class MqttPublisherMixin extends SettingsMixinDeviceBase { urlWithoutPath.pathname = ''; const client = this.client = connect(urlWithoutPath.toString(), { + rejectUnauthorized: false, username, password, });