Browse Source

fix: ssl connection with file path is not handled correctly

pull/5444/head
Wing-Kam Wong 2 years ago
parent
commit
7ef653370f
  1. 21
      packages/nocodb-nest/src/utils/common/NcConnectionMgr.ts

21
packages/nocodb-nest/src/utils/common/NcConnectionMgr.ts

@ -73,25 +73,34 @@ export default class NcConnectionMgr {
connectionConfig.connection.ssl.caFilePath &&
!connectionConfig.connection.ssl.ca
) {
connectionConfig.connection.ssl.ca = await promisify(fs.readFile)(
connectionConfig.connection.ssl.caFilePath,
connectionConfig.connection.ssl.ca = (
await promisify(fs.readFile)(
connectionConfig.connection.ssl.caFilePath,
)
).toString();
delete connectionConfig.connection.ssl.caFilePath;
}
if (
connectionConfig.connection.ssl.keyFilePath &&
!connectionConfig.connection.ssl.key
) {
connectionConfig.connection.ssl.key = await promisify(fs.readFile)(
connectionConfig.connection.ssl.keyFilePath,
connectionConfig.connection.ssl.key = (
await promisify(fs.readFile)(
connectionConfig.connection.ssl.keyFilePath,
)
).toString();
delete connectionConfig.connection.ssl.keyFilePath;
}
if (
connectionConfig.connection.ssl.certFilePath &&
!connectionConfig.connection.ssl.cert
) {
connectionConfig.connection.ssl.cert = await promisify(fs.readFile)(
connectionConfig.connection.ssl.certFilePath,
connectionConfig.connection.ssl.cert = (
await promisify(fs.readFile)(
connectionConfig.connection.ssl.certFilePath,
)
).toString();
delete connectionConfig.connection.ssl.certFilePath;
}
}

Loading…
Cancel
Save