Skip to content

SSL sockets may leak when keepalive is enabled #5699

Closed
@alexpenev-s

Description

@alexpenev-s

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 getName ca 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.httpIssues or PRs related to the http subsystem.httpsIssues or PRs related to the https subsystem.memoryIssues and PRs related to the memory management or memory footprint.netIssues and PRs related to the net subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions