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 Myles Borins committed 2016-01-19 11:52:32 -08:00
1 parent 44ee33f945
commit 751fbd84dd
2 files changed
+56

No files matched your search

+4
View File
@@ -123,6 +123,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;
};