support ssl params for pg-native (#1169)

Make pg-native able to pass sslmode, sslca, sslkey and sslcert params to libpq
This commit is contained in:
Ary Purnomoz 2017-04-19 21:55:56 +07:00 committed by Brian C
parent 0e2625b74e
commit 4505ae98d9

View File

@ -79,6 +79,12 @@ ConnectionParameters.prototype.getLibpqConnectionString = function(cb) {
add(params, this, 'application_name');
add(params, this, 'fallback_application_name');
var ssl = typeof this.ssl === 'object' ? this.ssl : {sslmode: this.ssl};
add(params, ssl, 'sslmode');
add(params, ssl, 'sslca');
add(params, ssl, 'sslkey');
add(params, ssl, 'sslcert');
if(this.database) {
params.push("dbname='" + this.database + "'");
}