-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: self signed certificate in certificate chain #695
Comments
Any ideas why this might be happening? |
Have the same problem with node 4.1 and node-gyp 3.0.3:
|
Same problem. It doesn't seem to be respecting my global configuration settings for some reason. basically impossible to install behind a corporate proxy. |
Same issue here, can we get a fix for this pelase! |
i found this comment on another issue and it seems to work #448 (comment). just set that environment variable. This is a hacky work around though, node-gyp should respect npmrc. |
node-gyp doesn't use the npm registry, it downloads the tarball from https://nodejs.org/. Setting |
why close this? it seems to be a pretty common issue for a lot of people downloading packages that require node-gyp, and I just installed newest nodejs and npm and am still getting this issue. Using the NODE_TLS_REJECT_UNAUTHORIZED=0 may work, but it is a hack fix. |
Knowing what you know, what would you have node-gyp do differently? |
knowing what I know, I know that this has surpassed my scope of knowledge as far as the internal workings of node-gyp, but would it be possible to have a config file for just node-gyp in which you can set settings like this? |
Excuse my ignorance but how do you use NODE_TLS_REJECT_UNAUTHORIZED=0 I'm on Windows using cmd Do I set this in the: npm confit set NODE_TLS_REJECT_UNAUTHORIZED=0 |
Config* sorry |
from command line you can do: |
Or you can set it as a windows environment variable but I would recommend the first option. |
Cool thanks @weagle08 |
It's certainly possible but it's not strictly necessary. node-gyp respects the traditional https_proxy environment variable (as does npm, I think.) |
Unfortunately where I work no proxy is provided so these variables don't help. My company plays man in the middle and injects certs and there is nothing I can do about it. |
Same issues with the cert injection. I had to modify the node gyp source to remove reference to https:// and rebuild it. The problem is that it doesn't respect the tls config when downloading the tarball. |
Since node-gyp is a tool for nodejs, but not resides inside of nodejs, I can fully understand why it should not use the node/npm configs for setting the network environment. But I must also agree with the others, that node-gyp should provide it's (optional) own config file, because in my case the system proxy environment is not enough, too: My company's proxy also established a MitM scenario, so I need a The 'workaround' with
|
#837 - adds a |
so there is now a command line option to provide ca file ... any idea how to engage that when node-gyp is getting called by the NPM install process? i'm not the one calling node-gyp, npm is, via the project file of the module being installed. the solution seems to remain the NODE_TLS_REJECT_UNAUTHORIZED=0 hack. |
If you have the |
The |
I am on RHEL7 and I tried
|
This would be much better addressed by fixing nodejs/node#3159. Playing whack-a-mole with npm, Atom, VS code, cUrl, Firefox, &c, &c, &c each using their own cert store when the OS supplies one is an unmanageable mess. If that's not immediately supported, a standard cafile environment variable that's honored by all parties would at least help. |
Can this be helpful? |
No, because I don't want to disable all certificate validation. Decrypting network hardware (substituting their local certs) are used in high-security environments, and accepting every certificate from any source would radically undermine that. |
I work in an environment where our proxies also use this self-signed cert substitution technique. Is there a particular reason to not expect security appliance vendors and operators to start using signed certificates for their appliances? I think the only way we will see a change in behavior is to continue to place that expectation on the vendors and operators. And it's not just Node that has these "issues" dealing with self-signed certs. Every application I support that interacts with the internet is a headache because of this. |
|
Try uninstalling Angular/cli first and installing node-gyp and then try reinstalling Angular cli
It worked perfectly |
I ended with updating Node and everything else to last version and it helped. |
Same problem here. Running on MacOS, no proxy, no vpn, no custom certificates. Node 14 working finde, Node 16 broken:
Is there any way to trace what call is going on with the GET? I can open the URL just fine in any browser.
|
What finally worked for me is nodejs/help#3686 (comment) |
Thanks @andig I tried that. It works for the https://nodejs.org/download/release/v16.14.0/node-v16.14.0-headers.tar.gz file but after that it requires another file (which is not a tar.gz) and fails because of the certifcate issue as well. |
strict-ssl=false was the first thing that I tried and has been set to false since then |
Did you upgrade both npm and NODE to last version? |
Why should one? Is there any known fix? |
Yes. There was a fix. And it helped for me, but my version was 2 major less than current |
@Fjaoos did you ever fix this issue? |
I hit this issue on node v16.14.0 and v16.16.0. However, it works fine on v16.13.1. Is anyone looking into this? |
on windows, version v16.16.0. Is there a way to specify where the file should be downloaded from or do I have to hack the hosts file to avoid this blocking issue ? |
Unfortunately I do not remember but I am sure it was a mix of corporate proxy/firewall and very restricted windows clients. |
Is there a solution that actually works? I tried every suggestion...
... and
I also tried to manually download the tar.gz as described here: nodejs/help#3686 (comment), but that didn't change anything. Even if I have the tar.gz file in the \tmp directory, the command fails, because the commands loads multiple files, not only the tar.gz. Edit: This might be connected to the issues nodejs/node#3742, #448 and the already mentioned nodejs/help#3686, but the recommendations there are similar to those here. Edit2: Installing something with |
None of the other methods worked for me (see #695 (comment)), but this command finally solved the problem (on Windows 11):
|
After an hour of trying everything, |
node-gyp switched to make-fetch-happen, which does not support this this environment variable ... |
My .npmrc looks like this:
It shouldn't even try to open a SSL connection because I'm using HTTP for the registry.
npm install protractor
gives an error when running node-gyp "Error: self signed certificate in certificate chain":The text was updated successfully, but these errors were encountered: