Allow the user supplied tlsOptions to overridde the host name used for certification validation.

fork
Ângela Igreja 11 years ago
parent 3bd73c896c
commit 12554368fe

@ -1,4 +1,4 @@
var tls = require('tls'),
§var tls = require('tls'),
Socket = require('net').Socket,
EventEmitter = require('events').EventEmitter,
inherits = require('util').inherits,
@ -102,10 +102,11 @@ Connection.prototype.connect = function() {
if (config.tls) {
tlsOptions = {};
tlsOptions.host = config.host;
// Host name may be overridden the tlsOptions
for (var k in config.tlsOptions)
tlsOptions[k] = config.tlsOptions[k];
tlsOptions.socket = socket;
tlsOptions.host = config.host;
}
if (config.tls)
@ -1631,10 +1632,11 @@ Connection.prototype._starttls = function() {
var tlsOptions = {};
tlsOptions.host = this._config.host;
// Host name may be overridden the tlsOptions
for (var k in this._config.tlsOptions)
tlsOptions[k] = this._config.tlsOptions[k];
tlsOptions.socket = self._sock;
tlsOptions.host = this._config.host;
self._sock = tls.connect(tlsOptions, function() {
self._login();

Loading…
Cancel
Save