1
0
Fork 0

Fix database ssl connection

This commit is contained in:
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

View file

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