File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
packages/pg-connection-string Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ function parse(str) {
6565 config . ssl = false
6666 }
6767
68- if ( config . sslcert || config . sslkey || config . sslrootcert ) {
68+ if ( config . sslcert || config . sslkey || config . sslrootcert || config . sslmode ) {
6969 config . ssl = { }
7070 }
7171
@@ -90,11 +90,9 @@ function parse(str) {
9090 case 'require' :
9191 case 'verify-ca' :
9292 case 'verify-full' : {
93- config . ssl = config . ssl || true
9493 break
9594 }
9695 case 'no-verify' : {
97- config . ssl = config . ssl || { }
9896 config . ssl . rejectUnauthorized = false
9997 break
10098 }
Original file line number Diff line number Diff line change @@ -258,25 +258,25 @@ describe('parse', function () {
258258 it ( 'configuration parameter sslmode=prefer' , function ( ) {
259259 var connectionString = 'pg:///?sslmode=prefer'
260260 var subject = parse ( connectionString )
261- subject . ssl . should . eql ( true )
261+ subject . ssl . should . eql ( { } )
262262 } )
263263
264264 it ( 'configuration parameter sslmode=require' , function ( ) {
265265 var connectionString = 'pg:///?sslmode=require'
266266 var subject = parse ( connectionString )
267- subject . ssl . should . eql ( true )
267+ subject . ssl . should . eql ( { } )
268268 } )
269269
270270 it ( 'configuration parameter sslmode=verify-ca' , function ( ) {
271271 var connectionString = 'pg:///?sslmode=verify-ca'
272272 var subject = parse ( connectionString )
273- subject . ssl . should . eql ( true )
273+ subject . ssl . should . eql ( { } )
274274 } )
275275
276276 it ( 'configuration parameter sslmode=verify-full' , function ( ) {
277277 var connectionString = 'pg:///?sslmode=verify-full'
278278 var subject = parse ( connectionString )
279- subject . ssl . should . eql ( true )
279+ subject . ssl . should . eql ( { } )
280280 } )
281281
282282 it ( "configuration parameter sslmode=require doesn't overwrite sslrootcert=/path/to/ca" , function ( ) {
You can’t perform that action at this time.
0 commit comments