fix: pg db connection problem
This commit is contained in:
parent
cf81ad910d
commit
d651412d34
@ -39,6 +39,7 @@ module.exports = {
|
|||||||
let sslOptions = null
|
let sslOptions = null
|
||||||
if (dbUseSSL && _.isPlainObject(dbConfig) && _.get(dbConfig, 'sslOptions.auto', null) === false) {
|
if (dbUseSSL && _.isPlainObject(dbConfig) && _.get(dbConfig, 'sslOptions.auto', null) === false) {
|
||||||
sslOptions = dbConfig.sslOptions
|
sslOptions = dbConfig.sslOptions
|
||||||
|
sslOptions.rejectUnauthorized = _.get(sslOptions, 'rejectUnauthorized', true)
|
||||||
if (sslOptions.ca) {
|
if (sslOptions.ca) {
|
||||||
sslOptions.ca = fs.readFileSync(path.resolve(WIKI.ROOTPATH, sslOptions.ca))
|
sslOptions.ca = fs.readFileSync(path.resolve(WIKI.ROOTPATH, sslOptions.ca))
|
||||||
}
|
}
|
||||||
@ -60,7 +61,7 @@ module.exports = {
|
|||||||
dbClient = 'pg'
|
dbClient = 'pg'
|
||||||
|
|
||||||
if (dbUseSSL && _.isPlainObject(dbConfig)) {
|
if (dbUseSSL && _.isPlainObject(dbConfig)) {
|
||||||
dbConfig.ssl = sslOptions
|
dbConfig.ssl = (sslOptions === true) ? { rejectUnauthorized: true } : sslOptions
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'mariadb':
|
case 'mariadb':
|
||||||
@ -106,7 +107,6 @@ module.exports = {
|
|||||||
connection: dbConfig,
|
connection: dbConfig,
|
||||||
pool: {
|
pool: {
|
||||||
...WIKI.config.pool,
|
...WIKI.config.pool,
|
||||||
propagateCreateError: false,
|
|
||||||
async afterCreate(conn, done) {
|
async afterCreate(conn, done) {
|
||||||
// -> Set Connection App Name
|
// -> Set Connection App Name
|
||||||
switch (WIKI.config.db.type) {
|
switch (WIKI.config.db.type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user