You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SSL sockets may leak when keepalive is enabled #5699
issue is in: lib/_http_agent.js
The issue is reproducible whenever the ca property is set globally in the agent and an https request is made with https.request(ops) where ops does not have the property ca
_http_agent.js @ Agent.prototype.createSocket
the options are extended with the global options object which contains ca. In getNameca is used in the name generation of the hash.
however _http_agent.js @ Agent.prototype.addRequest
The options (passed from the call https.request(ops) which don't have the property ca) are used to get a hashtag which is now different. The socket leaks and is closed when the timeout hits. Meanwhile a new socket is created for the request.
Nice spotting and nice fix. Worth mentioning that the only place that addRequest uses options except in getName is when it calls createSocket itself - so this is a backwards compatibly.
Would you be willing to make a pull request of your branch against node @saperal ?
Activity
benjamingr commentedon Mar 14, 2016
It's worth mentioning that this happens because
getNameis overridden in prototypical inheritance in `https://github.com/nodejs/node/blob/master/lib/https.js#L114 - _http_agent is not aware of the ca property.benjamingr commentedon Mar 14, 2016
Nice spotting and nice fix. Worth mentioning that the only place that
addRequestusesoptionsexcept ingetNameis when it callscreateSocketitself - so this is a backwards compatibly.Would you be willing to make a pull request of your branch against node @saperal ?
alexpenev-s commentedon Mar 15, 2016
Done #5713
https: fix ssl socket leak when keepalive is used
https: fix ssl socket leak when keepalive is used
https: fix ssl socket leak when keepalive is used