Fix database ssl connection

pull/5487/head
Chocobozzz 2021-04-19 09:25:11 +02:00
parent b9244002fc
commit 6bc672da81
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 11 additions and 2 deletions

View File

@ -51,18 +51,27 @@ const dbname = CONFIG.DATABASE.DBNAME
const username = CONFIG.DATABASE.USERNAME
const password = CONFIG.DATABASE.PASSWORD
const host = CONFIG.DATABASE.HOSTNAME
const ssl = CONFIG.DATABASE.SSL
const port = CONFIG.DATABASE.PORT
const poolMax = CONFIG.DATABASE.POOL.MAX
let dialectOptions: any = {}
if (CONFIG.DATABASE.SSL) {
dialectOptions = {
ssl: {
rejectUnauthorized: false
}
}
}
const sequelizeTypescript = new SequelizeTypescript({
database: dbname,
dialect: 'postgres',
dialectOptions,
host,
port,
username,
password,
ssl,
pool: {
max: poolMax
},