Updates
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user