mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
fix(core): Add an option to enable postgres ssl with default certs (#6889)
CP-809
This commit is contained in:
parent
b3247e5935
commit
789e1e7ed4
|
@ -90,7 +90,7 @@ export function getConnectionOptions(dbType: DatabaseType): ConnectionOptions {
|
||||||
const sslKey = config.getEnv('database.postgresdb.ssl.key');
|
const sslKey = config.getEnv('database.postgresdb.ssl.key');
|
||||||
const sslRejectUnauthorized = config.getEnv('database.postgresdb.ssl.rejectUnauthorized');
|
const sslRejectUnauthorized = config.getEnv('database.postgresdb.ssl.rejectUnauthorized');
|
||||||
|
|
||||||
let ssl: TlsOptions | undefined;
|
let ssl: TlsOptions | boolean = config.getEnv('database.postgresdb.ssl.enabled');
|
||||||
if (sslCa !== '' || sslCert !== '' || sslKey !== '' || !sslRejectUnauthorized) {
|
if (sslCa !== '' || sslCert !== '' || sslKey !== '' || !sslRejectUnauthorized) {
|
||||||
ssl = {
|
ssl = {
|
||||||
ca: sslCa || undefined,
|
ca: sslCa || undefined,
|
||||||
|
|
|
@ -92,6 +92,12 @@ export const schema = {
|
||||||
},
|
},
|
||||||
|
|
||||||
ssl: {
|
ssl: {
|
||||||
|
enabled: {
|
||||||
|
doc: 'If SSL should be enabled. If `ca`, `cert`, or `key` are defined, this will automatically default to true',
|
||||||
|
format: 'Boolean',
|
||||||
|
default: false,
|
||||||
|
env: 'DB_POSTGRESDB_SSL_ENABLED',
|
||||||
|
},
|
||||||
ca: {
|
ca: {
|
||||||
doc: 'SSL certificate authority',
|
doc: 'SSL certificate authority',
|
||||||
format: String,
|
format: String,
|
||||||
|
|
Loading…
Reference in a new issue