Browse Source

fix: read ssl cert files only if defined

Reading ssl cert files only if those files path are defined

re #215

Signed-off-by: Pranav C Balan <pranavxc@gmail.com>
pull/269/head
Pranav C Balan 3 years ago
parent
commit
533ff7a30b
  1. 6
      packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts

6
packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts

@ -749,16 +749,22 @@ export default abstract class BaseApiBuilder<T extends Noco> implements XcDynami
if (this.connectionConfig?.connection?.ssl && typeof this.connectionConfig?.connection?.ssl === 'object') {
if (this.connectionConfig.connection.ssl.caFilePath) {
this.connectionConfig.connection.ssl.ca = fs
.readFileSync(this.connectionConfig.connection.ssl.caFilePath)
.toString();
}
if (this.connectionConfig.connection.ssl.keyFilePath) {
this.connectionConfig.connection.ssl.key = fs
.readFileSync(this.connectionConfig.connection.ssl.keyFilePath)
.toString();
}
if (this.connectionConfig.connection.ssl.certFilePath) {
this.connectionConfig.connection.ssl.cert = fs
.readFileSync(this.connectionConfig.connection.ssl.certFilePath)
.toString();
}
}
const isSqlite = this.connectionConfig.client === 'sqlite3';
this.baseLog(`initDbDriver : initializing db driver first time`)

Loading…
Cancel
Save