mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
Support additional tls.connect() options (#1996)
* Support additional tls.connect() options * Pass-through all ssl options to tls.connect() * Fix lint error * Remove tls.checkServerIdentity explicit option
This commit is contained in:
parent
ced31dd911
commit
bf029c8270
@ -91,18 +91,9 @@ Connection.prototype.connect = function (port, host) {
|
||||
return self.emit('error', new Error('There was an error establishing an SSL connection'))
|
||||
}
|
||||
var tls = require('tls')
|
||||
const options = {
|
||||
socket: self.stream,
|
||||
checkServerIdentity: self.ssl.checkServerIdentity || tls.checkServerIdentity,
|
||||
rejectUnauthorized: self.ssl.rejectUnauthorized,
|
||||
ca: self.ssl.ca,
|
||||
pfx: self.ssl.pfx,
|
||||
key: self.ssl.key,
|
||||
passphrase: self.ssl.passphrase,
|
||||
cert: self.ssl.cert,
|
||||
secureOptions: self.ssl.secureOptions,
|
||||
NPNProtocols: self.ssl.NPNProtocols
|
||||
}
|
||||
const options = Object.assign({
|
||||
socket: self.stream
|
||||
}, self.ssl)
|
||||
if (net.isIP(host) === 0) {
|
||||
options.servername = host
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user