Skip to content

Commit f27245a

Browse files
committed
Revert "Revert "Support additional tls.connect() options (brianc#1996)" (brianc#2010)"
This reverts commit 510a273.
1 parent 1d48051 commit f27245a

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

packages/pg/lib/connection.js

+3-15
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,9 @@ Connection.prototype.connect = function (port, host) {
9393
return self.emit('error', new Error('There was an error establishing an SSL connection'))
9494
}
9595
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-
}
96+
const options = Object.assign({
97+
socket: self.stream
98+
}, self.ssl)
11199
if (net.isIP(host) === 0) {
112100
options.servername = host
113101
}

0 commit comments

Comments
 (0)