Remove SSL directory

This commit is contained in:
Benjamin Toby
2024-11-08 20:15:37 +01:00
parent b9d9a584b3
commit b337e5748f
6 changed files with 17 additions and 48 deletions
+7 -2
View File
@@ -7,12 +7,17 @@ const fs = require("fs");
*/
module.exports = function grabDbSSL() {
const SSL_DIR = process.env.DSQL_SSL_DIR;
if (!SSL_DIR?.match(/./)) return undefined;
if (!SSL_DIR?.match(/./)) {
console.log(
"No SSL certificate provided. Query will run in normal mode. To add SSL add an env path dir `DSQL_SSL_DIR` with a file named `ca-cert.pem`"
);
return undefined;
}
const caFilePath = `${SSL_DIR}/ca-cert.pem`;
if (!fs.existsSync(caFilePath)) {
console.log(`${caFilePath} does not exist`);
return undefined;
}