https: fix ssl socket leak when keepalive is used
authorAlexander Penev <alexander.penev@sap.com>
Mon, 14 Mar 2016 15:56:02 +0000 (17:56 +0200)
committerMyles Borins <mborins@us.ibm.com>
Wed, 30 Mar 2016 20:12:15 +0000 (13:12 -0700)
commit81876612f756f76b04e8a4212113e2e226b91375
tree9a8764c0d9831ef88ac791ff5e228535c86c3689
parentc0a24e4a1d8c881caedfaf864b964114cc8554c7
https: fix ssl socket leak when keepalive is used

SSL sockets leak whenever keep alive is enabled, ca option is set in
the global agent, and requests are sent without the ca property.
In the following case at Agent.prototype.createSocket a socket will
be created with a hashtag name that includes data from the global
agents’ ca property.

On subsequent requests at Agent.prototype.addRequest we do not find
the free socket, because the hashtag name generated there does not
take into account the global agents’ ca property, thus creating a new
socket and leaving the first socket to timeout. closes: #5699

PR-URL: https://github.com/nodejs/node/pull/5713
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
lib/_http_agent.js