Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFedor Indutny <fedor.indutny@gmail.com>2013-09-09 18:18:05 +0400
committerFedor Indutny <fedor.indutny@gmail.com>2013-09-09 18:18:05 +0400
commit1c3863abfd40b2d95b7151a75427d9fd948e8e63 (patch)
tree4d667488a5399f5412d43237d43fbd5a1757e436 /lib
parent3546825b1400dfead0d5f87dbd2278586ab4a9e2 (diff)
tls: fix setting NPN protocols
The NPN protocols was set on `require('tls')` or `global` object instead of being a local property. This fact lead to strange persistence of NPN protocols, and sometimes incorrect protocol selection (when no NPN protocols were passed in client options). fix #6168
Diffstat (limited to 'lib')
-rw-r--r--lib/tls.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/tls.js b/lib/tls.js
index ea3d2e43104..976ff463525 100644
--- a/lib/tls.js
+++ b/lib/tls.js
@@ -1321,12 +1321,13 @@ exports.connect = function(/* [port, host], options, cb */) {
var sslcontext = crypto.createCredentials(options);
- convertNPNProtocols(options.NPNProtocols, this);
+ var NPN = {};
+ convertNPNProtocols(options.NPNProtocols, NPN);
var hostname = options.servername || options.host || 'localhost',
pair = new SecurePair(sslcontext, false, true,
options.rejectUnauthorized === true ? true : false,
{
- NPNProtocols: this.NPNProtocols,
+ NPNProtocols: NPN.NPNProtocols,
servername: hostname,
cleartext: options.cleartext,
encrypted: options.encrypted