tls.connect({checkServerIdentity}) option cannot be a null - must be a method or not exist.

Defaults to built-in `tls.checkServerIdentity` method in the event one is not passed into `pgConfig.ssl`

Found breaking in v9.4.2 vs v9.4.1 a la 49054717b4ec0c6d477f04c2becd1f9680b2d13a

cc @tobio @brianc
This commit is contained in:
Matt Keas 2018-05-05 09:47:34 -05:00 committed by Brian C
parent 83ede28e18
commit 7de137f9f8

View File

@ -94,7 +94,7 @@ Connection.prototype.connect = function (port, host) {
self.stream = tls.connect({
socket: self.stream,
servername: host,
checkServerIdentity: self.ssl.checkServerIdentity,
checkServerIdentity: self.ssl.checkServerIdentity || tls.checkServerIdentity,
rejectUnauthorized: self.ssl.rejectUnauthorized,
ca: self.ssl.ca,
pfx: self.ssl.pfx,