Skip to content

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

@zy-zero

Description

@zy-zero

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.
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions