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

Ability to set NODE_EXTRA_CA_CERTS at runtime #13868

Open
sean256 opened this issue Sep 11, 2024 · 1 comment
Open

Ability to set NODE_EXTRA_CA_CERTS at runtime #13868

sean256 opened this issue Sep 11, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@sean256
Copy link

sean256 commented Sep 11, 2024

What is the problem this feature would solve?

I really want to use bun build --compile and include a custom ca in the bundle so my users don't have to bother setting NODE_EXTRA_CA_CERTS before running the standalone app.

What is the feature you are proposing to solve the problem?

Some hook to add a cert at runtime.

What alternatives have you considered?

I have yet to find any alternative that has worked. I have tried bunfig.toml preload, https global options, agent overrides...

@sean256 sean256 added the enhancement New feature or request label Sep 11, 2024
@redbmk
Copy link

redbmk commented Jan 9, 2025

I was thinking you could do this on startup:

  1. copy the contents of NODE_EXTRA_CA_CERTS if it already exists
  2. append your pre-bundled certs and write that final string to a temp file
  3. update process.env.NODE_EXTRA_CA_CERTS to point to the temp file

But that didn't seem to work

  1. it looks bun's fetch uses the value of NODE_EXTRA_CA_CERTS at startup, so changing it once bun is running doesn't help
  2. that would depend on a fix for NODE_EXTRA_CA_CERTS does not work with certificate bundle pem files (it does work with node) #13867

fwiw it doesn't seem like this is possible in node either without an external dependency on undici if I'm reading this right, though it would be nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants