Fix Postgres SSL support for existing none SSL connections

This commit is contained in:
Jan Oberhauser 2020-01-14 17:20:41 -06:00
parent fb55e5ab29
commit 03919a4c68

View file

@ -208,14 +208,12 @@ export class Postgres implements INodeType {
database: credentials.database as string,
user: credentials.user as string,
password: credentials.password as string,
ssl: credentials.ssl != 'disable',
sslmode: credentials.ssl as string
ssl: !['disable', undefined].includes(credentials.ssl as string | undefined),
sslmode: credentials.ssl as string || 'disable',
};
const db = pgp(config);
//const db = pgp(`postgres://${credentials.user}:${credentials.password}@${credentials.host}:${credentials.port}/${credentials.database}`);
let returnItems = [];
const items = this.getInputData();