Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with secure socket creation errors #113

Open
gguimond opened this issue Mar 21, 2023 · 0 comments · May be fixed by #114
Open

Issue with secure socket creation errors #113

gguimond opened this issue Mar 21, 2023 · 0 comments · May be fixed by #114

Comments

@gguimond
Copy link

When using an HTTPS agent, the creation of the secure socket can throw and as a result it raises an exception caught at node process level and the request is hanging forever (or timeout).

const secureSocket = super.createConnection({ ...options, socket })

To reproduce, specify a wrong key/certificate pair to agent options for example :

await request({
      method: 'GET',
      hostname: SERVER_HOSTNAME,
      port: server.address().port,
      path: '/',
      agent: new HttpsProxyAgent({
        keepAlive: true,
        keepAliveMsecs: 1000,
        maxSockets: 256,
        maxFreeSockets: 256,
        scheduling: 'lifo',
        /**
         * Enable SSL 2 ways and generate a 'createConnection' error with wrong key/cert pair
         */
        key: 'wrongkey',
        cert: 'wrongca',
        proxy: `https://${PROXY_HOSTNAME}:${proxy.address().port}`
      })
    })

The PR is on its way if you wish.

@gguimond gguimond linked a pull request Mar 21, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant