From cee56d9480d4c0d20a3ef7ef3bdfae8cc5f66b49 Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Sun, 14 Jan 2024 09:18:46 +0100 Subject: [PATCH] Add SSL certificate for local server --- engine/engine/utils/dbHandler.js | 3 +++ engine/engine/utils/noDatabaseDbHandler.js | 7 ++++++- package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/engine/engine/utils/dbHandler.js b/engine/engine/utils/dbHandler.js index 48199c0..9059f35 100644 --- a/engine/engine/utils/dbHandler.js +++ b/engine/engine/utils/dbHandler.js @@ -32,6 +32,9 @@ const connection = mysql.createConnection({ ? parseInt(process.env.DSQL_PORT) : undefined, timeout: 5000, + ssl: { + ca: fs.readFileSync(process.env.DSQL_SSL_CA_PATH || ""), + }, }); ////////////////////////////////////////////////////////////////////////////////// diff --git a/engine/engine/utils/noDatabaseDbHandler.js b/engine/engine/utils/noDatabaseDbHandler.js index 13c7d08..4958c90 100644 --- a/engine/engine/utils/noDatabaseDbHandler.js +++ b/engine/engine/utils/noDatabaseDbHandler.js @@ -10,8 +10,13 @@ const connection = mysql.createConnection({ user: process.env.DSQL_USER, password: process.env.DSQL_PASS, charset: "utf8mb4", - port: process.env.DSQL_PORT?.match(/.../) ? parseInt(process.env.DSQL_PORT) : undefined, + port: process.env.DSQL_PORT?.match(/.../) + ? parseInt(process.env.DSQL_PORT) + : undefined, timeout: 5000, + ssl: { + ca: fs.readFileSync(process.env.DSQL_SSL_CA_PATH || ""), + }, }); /** diff --git a/package.json b/package.json index cf39f90..9a95fad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "datasquirel", - "version": "1.9.6", + "version": "1.9.7", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": {