https: use servername in agent key

https requests with different SNI values should not be sent over the
same connection, even if the `host` is the same. Server may want to
present different certificate or route the incoming TLS connection
differently, depending on the received servername extension.

Fix: https://github.com/nodejs/node/issues/3940
PR-URL: https://github.com/nodejs/node/pull/4389
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Fedor Indutny authored and Jeremiah Senkpiel committed 2016-01-06 11:37:18 -05:00
1 parent 3d41a44dba
commit ca97e7276e
2 files changed
+56

No files matched your search

+4
View File
@@ -130,6 +130,10 @@ Agent.prototype.getName = function(options) {
if (options.rejectUnauthorized !== undefined)
name += options.rejectUnauthorized;
name += ':';
if (options.servername && options.servername !== options.host)
name += options.servername;
return name;
};