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

Error: Client network socket disconnected before secure TLS connection was established #357

Open
zy-zero opened this issue Aug 13, 2020 · 3 comments

Comments

@zy-zero
Copy link

zy-zero commented Aug 13, 2020

Windows
nodejs: 12.x
npm: 6.x
request-promise: 4.2.5
error: Client network socket disconnected before secure TLS connection was established
when I create a https get(or post) request use this lab, I will get an error recently ( sometime will get the error. not always ):
Client network socket disconnected before secure TLS connection was established
why?
Here is one I create use facebook api will get the error. same error will get when I use post method in other api.


    const options = {
        uri: `https://graph.facebook.com/v7.0/oauth/access_token?grant_type=fb_exchange_token&client_id=${client_id}&client_secret=${client_secret}&fb_exchange_token=${access_token}`,
        method: 'get',
        headers: {
        },
        json: true
    };
    try {
        refresh_res = await rp.get(options);
    } catch (e) {
        console.log(`ERROR: ${JSON.stringify(e)}`); // here will get the error.
    }
@xizhu-mstr
Copy link

xizhu-mstr commented Jan 26, 2021

I also meet the issue.
By investigation, there are two error codes for the failed requests: ECONNRESET and EPROTO.

This affects the stability of our product seriously.

I modified the underlying request logic to add retry if the error code is ECONNRESET or EPROTO. And now our logic can work.

But it is not the root cause. Still need your team to find the cause and fix.

@Marius-Ar
Copy link

Marius-Ar commented Jul 11, 2021

I'm having the same problem using the agent property making it impossible to use

@JHPWBN
Copy link

JHPWBN commented Oct 6, 2023

Hello all, I am running into the same problem:
  | Client network socket disconnected before secure TLS connection was established
at | connResetException (node:internal/errors:720:14)
at | TLSSocket. onConnectEnd (node:tls_wrap: 1655:19)
  | at TLSSocket. emit (node:events:529:35 )
  | at endReadableNT (node:internal/streams/readable: 1368:12)
  | at processTicksAndRejections (node: internal/process/ task

Running Homebridge 1.6.1 on Node.js Version v18.18.0 on macOS Ventura

Any thoughts on the reason would be appreciated!

Many thanks in Advance

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

No branches or pull requests

4 participants