apm icon indicating copy to clipboard operation
apm copied to clipboard

Cannot install packages due to "local issuer" certificate error

Open paulxtiseo opened this issue 6 years ago • 13 comments

I have a fresh install of Atom on Windows.

Atom : 1.25.1 Electron: 1.7.11 Chrome : 58.0.3029.110 Node : 7.9.0

I cannot install any additional packages due to certificates.

2018-04-12 10_42_44-settings atom

At work, we use Forcepoint for malware protection, and this software presents an FP HTTPS certificate instead of the original site's.

Preliminarily, following install instructions and doing a apm config set strict-ssl false, I am able to see "Featured Packages", but still cannot search Install Packages.

2018-04-12 11_09_50-settings c__users_ptiseo_ atom_ apm atom

Not sure what to do at this point, since official guides and posts on the forum don't seem to solve my specific issue. I feel I need to include the FP cert in a bundle somewhere, but don't know where.

Side note: I have Git separately on my system, and it is able to fetch.

paulxtiseo avatar Apr 12 '18 15:04 paulxtiseo

I run into the same issue - however it appears to affect only the Atom UI part of it. If i run apm search javascript in the terminal (powershell, in my case) it seems to work - and also installing using the command-line works.

xmatthias avatar May 17 '18 06:05 xmatthias

I am behind a corporate proxy and indeed the Atom UI part show the "local issuer" certificate error. But from command line the apm search and apm install is working correctly.

vasiauvi avatar Feb 18 '19 11:02 vasiauvi

I am behind a corporate proxy and having the same issue. Funny enough the new proxy doesn't need any bash settings, so I can't really set any option to a proxy address.

wvidana avatar Aug 08 '19 21:08 wvidana

Worth to mention that apm works just fine, it only fails when using the UI (Atom->Settings->Install)

wvidana avatar Aug 21 '19 21:08 wvidana

Worth to mention that apm works just fine, it only fails when using the UI (Atom->Settings->Install)

I second this. Same issue. And same problem as @paulxtiseo. In Ruby on Windows, we solved this by adding my corporate's Certificate bundle in to the certificate chain.

APM searches and installs stuff fine. NPM searches and installs stuff fine. I thought I'd try to change the node version to my Node 13.x - didn't help.

If I could insert a pem or cer file and have it be used in the cert chain for the UI search and install, that'd be great!

Snackin avatar Dec 17 '19 22:12 Snackin

In your init.coffee file you need to add this process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0

vaibhavg98 avatar May 06 '20 10:05 vaibhavg98

Command to install the script has fixed the certificate issue ($ apm install script ). Ref: https://hackernoon.com/setting-up-atom-as-a-python-ide-a-how-to-guide-o6dd37ff

abhilash-keloth avatar Jul 22 '20 02:07 abhilash-keloth

First doing apm config set strict-ssl false and then apm install [package name] in the command line worked for me.

ghost avatar Dec 06 '21 00:12 ghost

In your init.coffee file you need to add this process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0

thankyou, it worked.

anshikagupta01 avatar Feb 19 '22 08:02 anshikagupta01

Thank you @vaibhavg98 it worked! Go to File > Init Script menu and add the line process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0

thalia2809 avatar Apr 18 '22 15:04 thalia2809

I have the same problem. Adding the suggested line to init.coffee did not work for me. I was able to install using apm on the command line.

By the way, I found the menu option at Atom > Init Script, not File > Init Script - maybe a Mac difference?

benrose-alation avatar Apr 18 '22 22:04 benrose-alation

Best practice is not to disable TLS verification as has been suggested but to make apm accept the corporate ca certificate.

apm is a node js application so add your corporate ca certificate according to node documentation

Creating the following environment variable pointing to the certificate and restarting Atom does the trick: NODE_EXTRA_CA_CERTS=[your CA certificate file path]

supersmo avatar Apr 27 '22 14:04 supersmo

On Atom 1.60 x64 and the NODE_EXTRA_CA_CERTS trick does not work. Are there any plans to support third party CAs?

tenaciousdlg avatar Jun 15 '22 13:06 tenaciousdlg