fix: option to ignore certificate errors #76

This commit is contained in:
leukipp
2025-09-19 15:52:09 +02:00
parent 0359742e70
commit 5ec6577b5a
2 changed files with 9 additions and 3 deletions
+3 -2
View File
@@ -49,8 +49,9 @@ const init = async () => {
};
// Connection settings
const options = user === null || password === null ? null : { username: user, password: password };
const masked = password === null ? "null" : "*".repeat(password.length);
const masked = password === null ? null : "*".repeat(password.length);
const options = user === null || password === null ? {} : { username: user, password: password };
options.rejectUnauthorized = !("ignore_certificate_errors" in ARGS);
console.log("MQTT Connecting:", `${user}:${masked}@${url.toString()}`);
INTEGRATION.client = mqtt.connect(url.toString(), options);