@@ -258,19 +258,24 @@ 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 ( { } )
261
+ subject . ssl . should . eql ( {
262
+ rejectUnauthorized : false ,
263
+ } )
262
264
} )
263
265
264
266
it ( 'configuration parameter sslmode=require' , function ( ) {
265
267
var connectionString = 'pg:///?sslmode=require'
266
268
var subject = parse ( connectionString )
267
- subject . ssl . should . eql ( { } )
269
+ subject . ssl . should . eql ( {
270
+ rejectUnauthorized : false ,
271
+ } )
268
272
} )
269
273
270
274
it ( 'configuration parameter sslmode=verify-ca' , function ( ) {
271
275
var connectionString = 'pg:///?sslmode=verify-ca'
272
276
var subject = parse ( connectionString )
273
- subject . ssl . should . eql ( { } )
277
+ subject . ssl . should . have . property ( 'checkServerIdentity' ) . that . is . a ( 'function' )
278
+ expect ( subject . ssl . checkServerIdentity ( ) ) . be . undefined
274
279
} )
275
280
276
281
it ( 'configuration parameter sslmode=verify-full' , function ( ) {
@@ -282,9 +287,9 @@ describe('parse', function () {
282
287
it ( 'configuration parameter ssl=true and sslmode=require still work with sslrootcert=/path/to/ca' , function ( ) {
283
288
var connectionString = 'pg:///?ssl=true&sslrootcert=' + __dirname + '/example.ca&sslmode=require'
284
289
var subject = parse ( connectionString )
285
- subject . ssl . should . eql ( {
286
- ca : 'example ca\n' ,
287
- } )
290
+ subject . ssl . should . have . property ( 'ca' , 'example ca\n' )
291
+ subject . ssl . should . have . property ( 'checkServerIdentity' ) . that . is . a ( 'function' )
292
+ expect ( subject . ssl . checkServerIdentity ( ) ) . be . undefined
288
293
} )
289
294
290
295
it ( 'allow other params like max, ...' , function ( ) {
0 commit comments