Skip to main content
Hi,

I get this error for 'sfdx force:org:list` or for any 'sfdx` command. I re-installed node, npm and sfdx cli without luck. My workaround is `export NODE_TLS_REJECT_UNAUTHORIZED=0` that is not ideal. Any suggestion?

Also `npm config ls -l` lists `cafile = "/etc/ssl/certs/xxxxxCA.pem` that does exist. 

Error: self signed certificate in certificate chain

    at TLSSocket.onConnectSecure (_tls_wrap.js:1497:34)

    at TLSSocket.emit (events.js:315:20)

    at TLSSocket._finishInit (_tls_wrap.js:932:8)

    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:706:12) {

  code: 'SELF_SIGNED_CERT_IN_CHAIN'

}
7 answers
  1. Feb 22, 2024, 11:18 AM

    hello,

    There are 2 setup that needs to be done:

    1- to use sfdx, in standalone mode, define an environment variable, with a path to your CA certificate: NODE_EXTRA_CA_CERTS

    2- to use the sf plugin in visual studio code, there is a new setting that needs to be set with a path to your CA certificate : salesforcedx-vscode-core.NODE_EXTRA_CA_CERTS

    cheers

0/9000