Skip to content

Commit

Permalink
chore: use CA_CERT env
Browse files Browse the repository at this point in the history
  • Loading branch information
slowbackspace committed Oct 23, 2023
1 parent a3635b4 commit 63ea31f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@ const loadConfig = () => {
: 5000,
idleTimeoutMs: process.env.DB_IDLE_TIMEOUT ? Number(process.env.DB_IDLE_TIMEOUT) : 10000,
ssl:
process.env.DB_SSL !== undefined
? JSON.parse(process.env.DB_SSL)
: {
rejectUnauthorized: false,
},
process.env.DATABASE_SSL !== 'false'
? process.env.CA_CERT
? {
rejectUnauthorized: true,
ca: process.env.CA_CERT,
}
: {
rejectUnauthorized: false,
}
: false,
},
};
};
Expand Down

0 comments on commit 63ea31f

Please sign in to comment.