“ERROR: self signed certificate in certificate chain.” on SFDX force:auth:web:login

3.3K    Asked by DeirdreCameron in Salesforce , Asked on Apr 16, 2021

Could not find the issue hence asking, after updating SFDx to v43. When trying to connect to a sandbox i am getting -

"ERROR: self signed certificate in certificate chain"

I have run below commands but it didn't resolved the issue:set NODE_TLS_REJECT_UNAUTHORIZED=0 set HTTPS_PROXY= {https proxy}

there are no other process running on port 1717 on my machine , Is there any way possible to get past this without using the CA signed certs? Why node_tls_reject_unauthorized set to 0?

Answered by Diana Campbell

Thanks Stas, I had a look but it seems to be requiring certs. I was able to make it work by following below steps. Set Windows Env Variable NODE_TLS_REJECT_UNAUTHORIZED with Value =0.

Log Off and Log in to windows Ideally it's the similar to command - set NODE_TLS_REJECT_UNAUTHORIZED=0 but somehow it didn't worked for me but worked for my colleague.



Your Answer

Answer (1)

The "ERROR: Self Signed Certificate In Certificate Chain" message typically indicates an issue with the SSL certificate chain when attempting to authenticate with Salesforce DX (SFDX) using the force:auth:web:login command. This error can occur for various reasons, including problems with the SSL certificate configuration on the Salesforce instance or issues with your local environment.


Here are some steps you can take to troubleshoot and resolve this issue:

1. Verify Salesforce Instance SSL Certificate:

Make sure that the SSL certificate of the Salesforce instance you are trying to authenticate against is valid and not self-signed.

Check the certificate details to ensure it's issued by a trusted Certificate Authority (CA) and has not expired.

If you're unsure about the certificate status, contact your Salesforce administrator or Salesforce support for assistance.

2. Ensure Network Connectivity:

Verify that your local machine has a stable internet connection and can reach the Salesforce login endpoint (login.salesforce.com or test.salesforce.com) without any network issues.

If you're behind a proxy or firewall, ensure that it's properly configured to allow connections to Salesforce.

3. Update Salesforce CLI:

Ensure that you are using the latest version of Salesforce CLI. Run sfdx update to update to the latest version.

Older versions of Salesforce CLI may have compatibility issues or bugs related to SSL certificate validation.

4. Check Local SSL Configuration:

Review the SSL configuration of your local development environment. Ensure that it's correctly configured to trust SSL certificates from trusted CAs.

If you're using a self-signed certificate for local development, make sure it's properly installed and trusted by your local system.

5. Try Different Authentication Methods:

Instead of using the force:auth:web:login command, try alternative authentication methods such as JWT-based authentication (force:auth:jwt:grant) or OAuth 2.0 authentication (force:auth:device:login).

Different authentication methods may bypass certain SSL certificate validation checks and work around the issue.

6. Temporary Workaround:

As a temporary workaround, you can try disabling SSL certificate validation in your local environment. However, this is not recommended for production use and should only be used as a last resort.

For example, in Node.js, you can set the NODE_TLS_REJECT_UNAUTHORIZED environment variable to 0 to bypass SSL certificate validation.

If none of the above steps resolve the issue, consider reaching out to Salesforce support or the Salesforce developer community for further assistance. They may be able to provide more specific guidance based on your environment and circumstances.


11 Months

Interviews

Parent Categories