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

Support ERL_CACERTS_PATH env var when reading certificates #8874

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

josevalim
Copy link
Contributor

This pull request allows setting an env var with the location of certificates.

Currently we are seeing a proliferation of env vars for reading certificates from in the Elixir community. Here are some examples:

This means anyone using Elixir/Erlang behind a proxy needs to setup several env vars, carefully reading the docs of each package that may do external HTTP requests.

For this reason, I was thinking about unifying them all in Elixir and provide a ELIXIR_CACERTS_PATH that is read at boot time. However, I believe a solution upstream in Erlang itself would be even better, as it would avoid the same issue (of several multiple env vars) happening within Erlang packages, escripts, etc.

I understand it is possible to call public_key:cacerts_load/1 but I don't believe it fully solves the problem:

  1. If we leave it up for each package to call public_key:cacerts_load/1, then we land in the same problem described here, but even worse, as one package would globally override the defaults of others

  2. If we leave it up for users of the packages to call it, then it means they need to add logic to each of their applications and packages that they use. And doing so for escripts is even harder.

I also think an env var is better than the application environment for running escripts and so on, where setting the application environment is not as straight-forward (it could be set via the ERL_AFLAGS/ERL_ZFLAGS but it is more verbose).

If this is accepted, please double check the environment variable name to see if it adheres to Erlang/OTP's standards.

Copy link
Contributor

github-actions bot commented Oct 1, 2024

CT Test Results

  2 files   17 suites   5m 56s ⏱️
284 tests 282 ✅ 2 💤 0 ❌
300 runs  298 ✅ 2 💤 0 ❌

Results for commit 5df31bc.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@IngelaAndin IngelaAndin added the team:PS Assigned to OTP team PS label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:PS Assigned to OTP team PS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants