Respect SSL setting from connection parameters
This commit is contained in:
parent
b26a4303a8
commit
1674359b57
@ -23,14 +23,14 @@ var Client = function(config) {
|
||||
|
||||
this.connection = c.connection || new Connection({
|
||||
stream: c.stream,
|
||||
ssl: c.ssl
|
||||
ssl: this.connectionParameters.ssl
|
||||
});
|
||||
this.queryQueue = [];
|
||||
this.binary = c.binary || defaults.binary;
|
||||
this.encoding = 'utf8';
|
||||
this.processID = null;
|
||||
this.secretKey = null;
|
||||
this.ssl = c.ssl || false;
|
||||
this.ssl = this.connectionParameters.ssl || false;
|
||||
};
|
||||
|
||||
util.inherits(Client, EventEmitter);
|
||||
|
@ -161,4 +161,12 @@ test('libpq connection string building', function() {
|
||||
assert.equal(subject.ssl, true);
|
||||
});
|
||||
|
||||
test('ssl is set on client', function() {
|
||||
var Client = require('../../../lib/client')
|
||||
var defaults = require('../../../lib/defaults');
|
||||
defaults.ssl = true;
|
||||
var c = new Client('postgres://user@password:host/database')
|
||||
assert(c.ssl, 'Client should have ssl enabled via defaults')
|
||||
})
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user