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

CA support for SSL connection to NPM registries #271

Closed
Tracked by #159
Trebh opened this issue Jul 6, 2022 · 13 comments · Fixed by #14416
Closed
Tracked by #159

CA support for SSL connection to NPM registries #271

Trebh opened this issue Jul 6, 2022 · 13 comments · Fixed by #14416
Labels
bun install Something that relates to the npm-compatible client enhancement New feature or request

Comments

@Trebh
Copy link

Trebh commented Jul 6, 2022

In a corporate environment this is often mandatory for connection to private NPM registries.

.npmrc config reference:
https://docs.npmjs.com/cli/v8/using-npm/config#ca

When acting as a NPM replacement, it should be possible to configure Bun with this option

@Jarred-Sumner Jarred-Sumner added enhancement New feature or request bun install labels Jul 8, 2022
@Electroid Electroid added the npm label Nov 1, 2022
@github-actions github-actions bot removed the npm label Nov 2, 2022
@Electroid Electroid added the bun install Something that relates to the npm-compatible client label Nov 3, 2022
@bswan0002
Copy link

bswan0002 commented Sep 10, 2023

+ cafile support please :)

@viceice
Copy link

viceice commented Sep 11, 2023

Bun should support OpenSSL SSL_CERT_FILE environment variables like NodeJS (with --use-openssl-ca option) to allow configuring custom root ca certificates via ENV

@bswan0002
Copy link

Bun should support OpenSSL SSL_CERT_FILE environment variables like NodeJS (with --use-openssl-ca option) to allow configuring custom root ca certificates via ENV

Nope, Bun PM not respecting those ENV variables when running bun install.

@viceice
Copy link

viceice commented Sep 11, 2023

I know, that's why I said it should. 😉

@tutturen
Copy link

The lack of this option makes it impossible to start using bun in our organization, because we can't install packages from our private registry.

@dengelma
Copy link

Are there any updates on this issue?

@BeGj
Copy link

BeGj commented Nov 10, 2023

Can anyone try this workaround for bun install?

set env NODE_TLS_REJECT_UNAUTHORIZED=0. It got supported after this merge request and it kind of works like a temporary workaround when using JOSE and fetching JWKS public certificate.

Might not be good enough temp workaround for prod, but it enables you to do some internal testing at least.

@agrison
Copy link

agrison commented Dec 11, 2023

Waiting also for a solution to configure the cafile from within the .bunfile.toml config file, but in the meantime NODE_TLS_REJECT_UNAUTHORIZED=0 bun install is working fine.

@admmasters
Copy link

Waiting also for a solution to configure the cafile from within the .bunfile.toml config file, but in the meantime NODE_TLS_REJECT_UNAUTHORIZED=0 bun install is working fine.

This doesn't seem to be working for our private registry.

 package "@types/express" not found <private-artifactory-url>/artifactory/api/npm/@types%2fexpress 404

@ryanc16
Copy link

ryanc16 commented Jan 10, 2024

This alone is a deal breaker for adoption in corporate/enterprise environments.

@lirc571
Copy link

lirc571 commented Apr 1, 2024

Related to #7124

The latest version does load /etc/ssl/certs/ca-certificates.crt on Ubuntu without any special configuration. I've been using it this way for a few months without problems.

@cirospaciari
Copy link
Member

We dont support yet the options --ca and --cafile but we support now NODE_EXTRA_CA_CERTS

@taorepoara
Copy link

taorepoara commented Aug 19, 2024

but we support now NODE_EXTRA_CA_CERTS

This works fine with Base64 certificate but not with DER certificate.

For those who have the problem here is a solution to convert the cer file: https://serverfault.com/a/992717

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bun install Something that relates to the npm-compatible client enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.