Browse Source

fix: pg db connection problem

pull/1749/head
NGPixel 4 years ago
parent
commit
d651412d34
1 changed files with 2 additions and 2 deletions
  1. 4
      server/core/db.js

4
server/core/db.js

@ -39,6 +39,7 @@ module.exports = {
let sslOptions = null
if (dbUseSSL && _.isPlainObject(dbConfig) && _.get(dbConfig, 'sslOptions.auto', null) === false) {
sslOptions = dbConfig.sslOptions
sslOptions.rejectUnauthorized = _.get(sslOptions, 'rejectUnauthorized', true)
if (sslOptions.ca) {
sslOptions.ca = fs.readFileSync(path.resolve(WIKI.ROOTPATH, sslOptions.ca))
}
@ -60,7 +61,7 @@ module.exports = {
dbClient = 'pg'
if (dbUseSSL && _.isPlainObject(dbConfig)) {
dbConfig.ssl = sslOptions
dbConfig.ssl = (sslOptions === true) ? { rejectUnauthorized: true } : sslOptions
}
break
case 'mariadb':
@ -106,7 +107,6 @@ module.exports = {
connection: dbConfig,
pool: {
...WIKI.config.pool,
propagateCreateError: false,
async afterCreate(conn, done) {
// -> Set Connection App Name
switch (WIKI.config.db.type) {

Loading…
Cancel
Save