Skip to content

Commit

Permalink
support ssl params for pg-native (#1169)
Browse files Browse the repository at this point in the history
Make pg-native able to pass sslmode, sslca, sslkey and sslcert params to libpq
  • Loading branch information
arypurnomoz authored and brianc committed Apr 19, 2017
1 parent 0e2625b commit 4505ae9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/connection-parameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "'");
}
Expand Down

0 comments on commit 4505ae9

Please sign in to comment.