Skip to content
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_CERT_IN_CHAIN downloading package manifest #7124

Closed
ajaykarpur opened this issue Nov 15, 2023 · 10 comments · Fixed by #13150
Closed

error: SELF_SIGNED_CERT_IN_CHAIN downloading package manifest #7124

ajaykarpur opened this issue Nov 15, 2023 · 10 comments · Fixed by #13150
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client

Comments

@ajaykarpur
Copy link

What version of Bun is running?

1.0.11+f7f6233ea

What platform is your computer?

Darwin 22.6.0 arm64 arm

What steps can reproduce the bug?

I am on a corporate laptop that uses a company self-signed cert.

I ran the command: bun install -g aws-cdk and got the following output:

bun add v1.0.11 (f7f6233e)
  🔍 aws-cdk [6/6]
error: SELF_SIGNED_CERT_IN_CHAIN downloading package manifest aws-cdk
error: aws-cdk@ failed to resolve

I tried following Node's solution for this issue, and I set the following environment variable:

export NODE_EXTRA_CA_CERTS="path_to_my_cert.pem"

This didn't seem to work. I also tried BUN_EXTRA_CA_CERTS, but that didn't work either.

What is the expected behavior?

Ideally, it would be possible to set an environment variable that points to my CA file, in precisely the same way it works for Node. (Or some other user-friendly method that is clearly documented.)

What do you see instead?

No response

Additional information

No response

@ajaykarpur ajaykarpur added the bug Something isn't working label Nov 15, 2023
@Electroid Electroid added the bun install Something that relates to the npm-compatible client label Nov 15, 2023
@ajaykarpur
Copy link
Author

@Jarred-Sumner do you happen to know if handling self-signed certs is a missing feature in Bun, or if there is already a way to do this that I'm not aware of?

@cirospaciari
Copy link
Member

@Jarred-Sumner do you happen to know if handling self-signed certs is a missing feature in Bun, or if there is already a way to do this that I'm not aware of?

We still do not support NODE_EXTRA_CA_CERTS but we support NODE_TLS_REJECT_UNAUTHORIZED=0

@JonCanning
Copy link

Is there a timeline for this? I've been migrating some services to Bun and this is a show stopper due to strict security requirements

@lirc571
Copy link

lirc571 commented Mar 20, 2024

Just tried this on a fresh installation of Ubuntu. Bun recognizes certificates from the default certificate store (/etc/ssl/certs/ca-certificates.crt for Ubuntu). No need to set any environment variable or node/bun config.

@Jarred-Sumner
Copy link
Collaborator

Just tried this on a fresh installation of Ubuntu. Bun recognizes certificates from the default certificate store (/etc/ssl/certs/ca-certificates.crt for Ubuntu). No need to set any environment variable or node/bun config.

I don't think this is intentional tbh

@lirc572
Copy link

lirc572 commented Mar 20, 2024

Just tried this on a fresh installation of Ubuntu. Bun recognizes certificates from the default certificate store (/etc/ssl/certs/ca-certificates.crt for Ubuntu). No need to set any environment variable or node/bun config.

I don't think this is intentional tbh

I think using the operating system's certificate store as the default is okay. At least this is what Golang is doing.

It is good to provide an option to update the setting (something like NODE_EXTRA_CA_CERTS).

@mustafamoe
Copy link

I just faced the same issue as well.

SELF_SIGNED_CERT_IN_CHAIN: self signed certificate in certificate chain

@pierre-mike-pge
Copy link

Same for me
On a corporate Macbook.

@zwarag
Copy link

zwarag commented Apr 11, 2024

I also have this issue on a corporate Macbook.

@chvvhbabu
Copy link

I've tried NODE_TLS_REJECT_UNAUTHORIZED, as a work around. Bun install succeeded without complaining SELF_SIGNED_CERT_IN_CHAIN, but that didn't download the package properly. This is strange!!!

Any idea when this would be supported or is there a work around?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client
Projects
None yet
Development

Successfully merging a pull request may close this issue.