Skip to content

Node v18+ - TLS - local issuer problem #4238

Closed as not planned
Closed as not planned
@DesmoGiec

Description

@DesmoGiec

Details

Hello :)
I'm trying to run a discordjs over nodejs on my webhost, but I'm having an issue.
With nodejs v16 all works perfectly.
discordjs requires nodejs 16.1+, I'm on 16.2 so no problem at all, for now.
But for the future I'd like to update nodejs, but here's the issue.
When I try to run the app, I got this error:

[Discord (18)] [pcdjkska@hostingssd84 Bot]$ node index
Error: unable to get local issuer certificate
    at TLSSocket.onConnectSecure (node:_tls_wrap:1540:34)
    at TLSSocket.emit (node:events:513:28)
    at TLSSocket._finishInit (node:_tls_wrap:959:8)
    at ssl.onhandshakedone (node:_tls_wrap:743:12) {
  code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'
}

I've tried with disabling ssl in strict-ssl npm cmd, tried to generate CA certs and use NODE_EXTRA_CA_CERTS...
Nothing worked.
I have no clues, hope somebody can help me figuring out what's wrong..
Thanks in advance.
Mirko

Node.js version

v16 ok, from 18 the issue shows up.

Example code

No code. Even with an empty index.js the issue shows up.
Just by doing node index.js it triggers

Operating system

It's a unix webhost, cPanel present.

Scope

runtime

Module and version

Not applicable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions