import fs from "fs"; import path from "path"; /** * # Grab SSL */ export default function grabDbSSL() { const caProivdedPath = process.env.DSQL_SSL_CA_CERT; if (!caProivdedPath?.match(/./)) { return undefined; } const caFilePath = path.resolve(process.cwd(), caProivdedPath); if (!fs.existsSync(caFilePath)) { console.log(`${caFilePath} does not exist`); return undefined; } return { ca: fs.readFileSync(caFilePath), rejectUnauthorized: false, }; }