File tree Expand file tree Collapse file tree 2 files changed +6
-34
lines changed
Expand file tree Collapse file tree 2 files changed +6
-34
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,6 @@ var Writer = require('buffer-writer')
1515// eslint-disable-next-line
1616var PacketStream = require ( 'pg-packet-stream' )
1717
18- var warnDeprecation = require ( './compat/warn-deprecation' )
19-
2018var TEXT_MODE = 0
2119
2220// TODO(bmc) support binary mode here
@@ -95,21 +93,9 @@ Connection.prototype.connect = function (port, host) {
9593 return self . emit ( 'error' , new Error ( 'There was an error establishing an SSL connection' ) )
9694 }
9795 var tls = require ( 'tls' )
98- const options = {
99- socket : self . stream ,
100- checkServerIdentity : self . ssl . checkServerIdentity || tls . checkServerIdentity ,
101- rejectUnauthorized : self . ssl . rejectUnauthorized ,
102- ca : self . ssl . ca ,
103- pfx : self . ssl . pfx ,
104- key : self . ssl . key ,
105- passphrase : self . ssl . passphrase ,
106- cert : self . ssl . cert ,
107- secureOptions : self . ssl . secureOptions ,
108- NPNProtocols : self . ssl . NPNProtocols
109- }
110- if ( typeof self . ssl . rejectUnauthorized !== 'boolean' ) {
111- warnDeprecation ( 'Implicit disabling of certificate verification is deprecated and will be removed in pg 8. Specify `rejectUnauthorized: true` to require a valid CA or `rejectUnauthorized: false` to explicitly opt out of MITM protection.' , 'PG-SSL-VERIFY' )
112- }
96+ const options = Object . assign ( {
97+ socket : self . stream
98+ } , self . ssl )
11399 if ( net . isIP ( host ) === 0 ) {
114100 options . servername = host
115101 }
Original file line number Diff line number Diff line change @@ -14,8 +14,6 @@ var util = require('util')
1414var Writer = require ( 'buffer-writer' )
1515var Reader = require ( 'packet-reader' )
1616
17- var warnDeprecation = require ( './compat/warn-deprecation' )
18-
1917var TEXT_MODE = 0
2018var BINARY_MODE = 1
2119var Connection = function ( config ) {
@@ -93,21 +91,9 @@ Connection.prototype.connect = function (port, host) {
9391 return self . emit ( 'error' , new Error ( 'There was an error establishing an SSL connection' ) )
9492 }
9593 var tls = require ( 'tls' )
96- const options = {
97- socket : self . stream ,
98- checkServerIdentity : self . ssl . checkServerIdentity || tls . checkServerIdentity ,
99- rejectUnauthorized : self . ssl . rejectUnauthorized ,
100- ca : self . ssl . ca ,
101- pfx : self . ssl . pfx ,
102- key : self . ssl . key ,
103- passphrase : self . ssl . passphrase ,
104- cert : self . ssl . cert ,
105- secureOptions : self . ssl . secureOptions ,
106- NPNProtocols : self . ssl . NPNProtocols
107- }
108- if ( typeof self . ssl . rejectUnauthorized !== 'boolean' ) {
109- warnDeprecation ( 'Implicit disabling of certificate verification is deprecated and will be removed in pg 8. Specify `rejectUnauthorized: true` to require a valid CA or `rejectUnauthorized: false` to explicitly opt out of MITM protection.' , 'PG-SSL-VERIFY' )
110- }
94+ const options = Object . assign ( {
95+ socket : self . stream
96+ } , self . ssl )
11197 if ( net . isIP ( host ) === 0 ) {
11298 options . servername = host
11399 }
You can’t perform that action at this time.
0 commit comments