Skip to content

Commit

Permalink
Revert "Support additional tls.connect() options (#1996)" (#2010)
Browse files Browse the repository at this point in the history
This reverts commit bf029c8.
  • Loading branch information
brianc committed Nov 20, 2019
1 parent c10a96c commit 510a273
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/connection.js
Expand Up @@ -91,9 +91,18 @@ 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 = Object.assign({
socket: self.stream
}, self.ssl)
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
}
if (net.isIP(host) === 0) {
options.servername = host
}
Expand Down

0 comments on commit 510a273

Please sign in to comment.