mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
parent
43114f4c99
commit
7b62226d57
4
index.js
4
index.js
@ -49,6 +49,10 @@ function parse(str) {
|
||||
config.ssl = true;
|
||||
}
|
||||
|
||||
if (config.ssl === '0') {
|
||||
config.ssl = false;
|
||||
}
|
||||
|
||||
if (config.sslcert || config.sslkey || config.sslrootcert) {
|
||||
config.ssl = {};
|
||||
}
|
||||
|
||||
@ -150,6 +150,12 @@ describe('parse', function(){
|
||||
subject.ssl.should.equal(true);
|
||||
});
|
||||
|
||||
it('configuration parameter ssl=0', function(){
|
||||
var connectionString = 'pg:///?ssl=0';
|
||||
var subject = parse(connectionString);
|
||||
subject.ssl.should.equal(false);
|
||||
});
|
||||
|
||||
it('set ssl', function () {
|
||||
var subject = parse('pg://myhost/db?ssl=1');
|
||||
subject.ssl.should.equal(true);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user