diff --git a/engine/engine/utils/dbHandler.js b/engine/engine/utils/dbHandler.js index 9059f35..6101d13 100644 --- a/engine/engine/utils/dbHandler.js +++ b/engine/engine/utils/dbHandler.js @@ -33,7 +33,16 @@ const connection = mysql.createConnection({ : undefined, timeout: 5000, ssl: { - ca: fs.readFileSync(process.env.DSQL_SSL_CA_PATH || ""), + ca: (() => { + try { + if (process.env.DSQL_SSL_CA_PATH) { + return fs.readFileSync(process.env.DSQL_SSL_CA_PATH); + } + return undefined; + } catch (error) { + return undefined; + } + })(), }, }); diff --git a/engine/engine/utils/noDatabaseDbHandler.js b/engine/engine/utils/noDatabaseDbHandler.js index 4958c90..d950cba 100644 --- a/engine/engine/utils/noDatabaseDbHandler.js +++ b/engine/engine/utils/noDatabaseDbHandler.js @@ -15,7 +15,16 @@ const connection = mysql.createConnection({ : undefined, timeout: 5000, ssl: { - ca: fs.readFileSync(process.env.DSQL_SSL_CA_PATH || ""), + ca: (() => { + try { + if (process.env.DSQL_SSL_CA_PATH) { + return fs.readFileSync(process.env.DSQL_SSL_CA_PATH); + } + return undefined; + } catch (error) { + return undefined; + } + })(), }, }); diff --git a/package.json b/package.json index 9a95fad..6133da1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "datasquirel", - "version": "1.9.7", + "version": "1.9.8", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": {