File tree 2 files changed +6
-34
lines changed
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')
15
15
// eslint-disable-next-line
16
16
var PacketStream = require ( 'pg-packet-stream' )
17
17
18
- var warnDeprecation = require ( './compat/warn-deprecation' )
19
-
20
18
var TEXT_MODE = 0
21
19
22
20
// TODO(bmc) support binary mode here
@@ -95,21 +93,9 @@ Connection.prototype.connect = function (port, host) {
95
93
return self . emit ( 'error' , new Error ( 'There was an error establishing an SSL connection' ) )
96
94
}
97
95
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 )
113
99
if ( net . isIP ( host ) === 0 ) {
114
100
options . servername = host
115
101
}
Original file line number Diff line number Diff line change @@ -14,8 +14,6 @@ var util = require('util')
14
14
var Writer = require ( 'buffer-writer' )
15
15
var Reader = require ( 'packet-reader' )
16
16
17
- var warnDeprecation = require ( './compat/warn-deprecation' )
18
-
19
17
var TEXT_MODE = 0
20
18
var BINARY_MODE = 1
21
19
var Connection = function ( config ) {
@@ -93,21 +91,9 @@ Connection.prototype.connect = function (port, host) {
93
91
return self . emit ( 'error' , new Error ( 'There was an error establishing an SSL connection' ) )
94
92
}
95
93
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 )
111
97
if ( net . isIP ( host ) === 0 ) {
112
98
options . servername = host
113
99
}
You can’t perform that action at this time.
0 commit comments