Skip to content

Commit 510a273

Browse files
authored
Revert "Support additional tls.connect() options (brianc#1996)" (brianc#2010)
This reverts commit bf029c8.
1 parent c10a96c commit 510a273

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

lib/connection.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,18 @@ Connection.prototype.connect = function (port, host) {
9191
return self.emit('error', new Error('There was an error establishing an SSL connection'))
9292
}
9393
var tls = require('tls')
94-
const options = Object.assign({
95-
socket: self.stream
96-
}, self.ssl)
94+
const options = {
95+
socket: self.stream,
96+
checkServerIdentity: self.ssl.checkServerIdentity || tls.checkServerIdentity,
97+
rejectUnauthorized: self.ssl.rejectUnauthorized,
98+
ca: self.ssl.ca,
99+
pfx: self.ssl.pfx,
100+
key: self.ssl.key,
101+
passphrase: self.ssl.passphrase,
102+
cert: self.ssl.cert,
103+
secureOptions: self.ssl.secureOptions,
104+
NPNProtocols: self.ssl.NPNProtocols
105+
}
97106
if (net.isIP(host) === 0) {
98107
options.servername = host
99108
}

0 commit comments

Comments
 (0)