File tree 2 files changed +5
-7
lines changed
packages/pg-connection-string
2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ function parse(str) {
65
65
config . ssl = false
66
66
}
67
67
68
- if ( config . sslcert || config . sslkey || config . sslrootcert ) {
68
+ if ( config . sslcert || config . sslkey || config . sslrootcert || config . sslmode ) {
69
69
config . ssl = { }
70
70
}
71
71
@@ -90,11 +90,9 @@ function parse(str) {
90
90
case 'require' :
91
91
case 'verify-ca' :
92
92
case 'verify-full' : {
93
- config . ssl = config . ssl || true
94
93
break
95
94
}
96
95
case 'no-verify' : {
97
- config . ssl = config . ssl || { }
98
96
config . ssl . rejectUnauthorized = false
99
97
break
100
98
}
Original file line number Diff line number Diff line change @@ -258,25 +258,25 @@ describe('parse', function () {
258
258
it ( 'configuration parameter sslmode=prefer' , function ( ) {
259
259
var connectionString = 'pg:///?sslmode=prefer'
260
260
var subject = parse ( connectionString )
261
- subject . ssl . should . eql ( true )
261
+ subject . ssl . should . eql ( { } )
262
262
} )
263
263
264
264
it ( 'configuration parameter sslmode=require' , function ( ) {
265
265
var connectionString = 'pg:///?sslmode=require'
266
266
var subject = parse ( connectionString )
267
- subject . ssl . should . eql ( true )
267
+ subject . ssl . should . eql ( { } )
268
268
} )
269
269
270
270
it ( 'configuration parameter sslmode=verify-ca' , function ( ) {
271
271
var connectionString = 'pg:///?sslmode=verify-ca'
272
272
var subject = parse ( connectionString )
273
- subject . ssl . should . eql ( true )
273
+ subject . ssl . should . eql ( { } )
274
274
} )
275
275
276
276
it ( 'configuration parameter sslmode=verify-full' , function ( ) {
277
277
var connectionString = 'pg:///?sslmode=verify-full'
278
278
var subject = parse ( connectionString )
279
- subject . ssl . should . eql ( true )
279
+ subject . ssl . should . eql ( { } )
280
280
} )
281
281
282
282
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