Repository navigation
CA support for SSL connection to NPM registries #271
Description
Activity
- addedenhancementNew feature or requestNew feature or request
on Jul 8, 2022 - addedbun installSomething that relates to the npm-compatible clientSomething that relates to the npm-compatible client
on Nov 3, 2022 + cafile support please :)
Reacted by plantlover56, ryanc16, Sergey and WSDBun should support OpenSSL
SSL_CERT_FILEenvironment variables like NodeJS (with--use-openssl-caoption) to allow configuring custom root ca certificates via ENVBun should support OpenSSL
SSL_CERT_FILEenvironment variables like NodeJS (with--use-openssl-caoption) to allow configuring custom root ca certificates via ENVNope, Bun PM not respecting those ENV variables when running
bun install.Reacted by plantlover56I know, that's why I said it should. 😉
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.
Reacted by Michael Kriese, plantlover56, Thomas Bourigault, Max van Dongen, Dominik Engelmann, Samuel, Srikar Gudipati, ultish, Valentin, Stuart Myers and 22 moreAre there any updates on this issue?
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.
Reacted by Alexandre GrisonWaiting also for a solution to configure the
cafilefrom within the.bunfile.tomlconfig file, but in the meantimeNODE_TLS_REJECT_UNAUTHORIZED=0 bun installis working fine.Reacted by Ary WibowoWaiting also for a solution to configure the
cafilefrom within the.bunfile.tomlconfig file, but in the meantimeNODE_TLS_REJECT_UNAUTHORIZED=0 bun installis 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 404This alone is a deal breaker for adoption in corporate/enterprise environments.
Reacted by Thor Even Tutturen, Matt Revell, Paolo Božac, Sergey, Calder Coalson, Matthias Ebner, Julen Ruiz Aizpuru, Florian Barbare, Rostislav Simonik, 이정현 and 6 moreRelated to #7124
The latest version does load
/etc/ssl/certs/ca-certificates.crton Ubuntu without any special configuration. I've been using it this way for a few months without problems.We dont support yet the options
--caand--cafilebut we support nowNODE_EXTRA_CA_CERTSbut we support now
NODE_EXTRA_CA_CERTSThis works fine with Base64 certificate but not with DER certificate.
For those who have the problem here is a solution to convert the
cerfile: https://serverfault.com/a/992717
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