This commit is contained in:
Benjamin Toby
2025-07-20 07:00:09 +01:00
parent 3437be2c08
commit a429436939
9 changed files with 55 additions and 7 deletions
+5 -2
View File
@@ -1,6 +1,7 @@
import fs from "fs";
import grabDirNames from "./names/grab-dir-names";
import type { ConnectionConfig } from "mariadb";
import path from "path";
type Return = ConnectionConfig["ssl"] | undefined;
@@ -15,13 +16,15 @@ export default function grabDbSSL(): Return {
maxscaleSSLCaCertFileFinal = maxscaleSSLCaCertFile;
} catch (error) {}
const caFilePath =
const caProivdedPath =
process.env.DSQL_SSL_CA_CERT || maxscaleSSLCaCertFileFinal;
if (!caFilePath?.match(/./)) {
if (!caProivdedPath?.match(/./)) {
return undefined;
}
const caFilePath = path.resolve(process.cwd(), caProivdedPath);
if (!fs.existsSync(caFilePath)) {
console.log(`${caFilePath} does not exist`);
return undefined;