Skip to content

CA support for SSL connection to NPM registries #271

Description

@Trebh

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

Activity

  1. added
    bun installSomething that relates to the npm-compatible client
    on Nov 3, 2022
  2. bswan0002 commented on Sep 10, 2023

    @bswan0002

    + cafile support please :)

  3. viceice commented on Sep 11, 2023

    @viceice

    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

  4. bswan0002 commented on Sep 11, 2023

    @bswan0002

    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.

  5. viceice commented on Sep 11, 2023

    @viceice

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

  6. tutturen commented on Sep 11, 2023

    @tutturen

    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.

  7. dengelma commented on Oct 16, 2023

    @dengelma

    Are there any updates on this issue?

  8. BeGj commented on Nov 10, 2023

    @BeGj

    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.

  9. agrison commented on Dec 11, 2023

    @agrison

    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.

  10. admmasters commented on Dec 16, 2023

    @admmasters

    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
    
  11. ryanc16 commented on Jan 10, 2024

    @ryanc16

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

  12. lirc571 commented on Apr 1, 2024

    @lirc571

    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.

  13. cirospaciari commented on Aug 7, 2024

    @cirospaciari
    Member

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

  14. taorepoara commented on Aug 19, 2024

    @taorepoara

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bun installSomething that relates to the npm-compatible clientenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions