Fix always true if condition

pull/5418/head
Gabriel Ngandu-Biseba 2 months ago
parent d2b48a648f
commit 98ba019cf0

@ -263,7 +263,7 @@ class Database {
let sslConfig = null; let sslConfig = null;
let serverCa = undefined; let serverCa = undefined;
if (mariaDbUseSSL) { if (mariaDbUseSSL === true) {
serverCa = [ fs.readFileSync(mariaDbSslCert, "utf8") ]; serverCa = [ fs.readFileSync(mariaDbSslCert, "utf8") ];
sslConfig = { sslConfig = {
rejectUnauthorized: true, rejectUnauthorized: true,

@ -207,19 +207,17 @@ class SetupDatabase {
this.runningSetup = false; this.runningSetup = false;
return; return;
} }
// Test connection // Test connection
try { try {
let sslConfig = null; let sslConfig = null;
let serverCa = undefined; let serverCa = undefined;
if (mariaDbUseSSL) { if (mariaDbUseSSL === true) {
serverCa = [ fs.readFileSync(mariaDbSslCert, "utf8") ]; serverCa = [ fs.readFileSync(mariaDbSslCert, "utf8") ];
sslConfig = { sslConfig = {
rejectUnauthorized: true, rejectUnauthorized: true,
ca: serverCa ca: serverCa
}; };
} }
const connection = await mysql.createConnection({ const connection = await mysql.createConnection({
host: dbConfig.hostname, host: dbConfig.hostname,
port: dbConfig.port, port: dbConfig.port,

Loading…
Cancel
Save