From 98ba019cf08b3e46316763c5cefba35112131d6e Mon Sep 17 00:00:00 2001 From: Gabriel Ngandu-Biseba Date: Fri, 29 Nov 2024 11:42:06 +0100 Subject: [PATCH] Fix always true if condition --- server/database.js | 2 +- server/setup-database.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/server/database.js b/server/database.js index 55141faee..a452bfed1 100644 --- a/server/database.js +++ b/server/database.js @@ -263,7 +263,7 @@ class Database { let sslConfig = null; let serverCa = undefined; - if (mariaDbUseSSL) { + if (mariaDbUseSSL === true) { serverCa = [ fs.readFileSync(mariaDbSslCert, "utf8") ]; sslConfig = { rejectUnauthorized: true, diff --git a/server/setup-database.js b/server/setup-database.js index a73e28596..dc8486b8b 100644 --- a/server/setup-database.js +++ b/server/setup-database.js @@ -207,19 +207,17 @@ class SetupDatabase { this.runningSetup = false; return; } - // Test connection try { let sslConfig = null; let serverCa = undefined; - if (mariaDbUseSSL) { + if (mariaDbUseSSL === true) { serverCa = [ fs.readFileSync(mariaDbSslCert, "utf8") ]; sslConfig = { rejectUnauthorized: true, ca: serverCa }; } - const connection = await mysql.createConnection({ host: dbConfig.hostname, port: dbConfig.port,