1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

fix: Support proper SSL settings using DATABASE_SSL (#585)

As described in https://node-postgres.com/features/ssl , `ssl` is an object which will be passed to Node TLS socket.
Also:

```
(node:1) DeprecationWarning: Implicit disabling of certificate verification is deprecated and will be removed in pg 8. Specify `rejectUnauthorized: true` to require a valid CA or `rejectUnauthorized: false` to explicitly opt out of MITM protection.
```

This change makes it possible to configure accepted SSL CA certificate, or to accept self-signed certificate.
This commit is contained in:
Hendy Irawan 2020-04-18 21:29:05 +07:00 committed by GitHub
parent 637c4f4643
commit 1e9db236c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,7 +28,10 @@ function defaultOptions() {
host: process.env.DATABASE_HOST,
port: process.env.DATABASE_PORT || 5432,
database: process.env.DATABASE_NAME || 'unleash',
ssl: process.env.DATABASE_SSL,
ssl:
process.env.DATABASE_SSL != null
? JSON.parse(process.env.DATABASE_SSL)
: false,
driver: 'postgres',
},
port: process.env.HTTP_PORT || process.env.PORT || 4242,