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

Load certificates from systems keychain on darwin #8844

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

starbelly
Copy link
Contributor

@starbelly starbelly commented Sep 22, 2024

The systems root keychain contains well know root certificates, yet is non-modifiable. As such, internal CA certificates (both root and intermediate) tend to get installed into the systems keychain in the context of an private organization. Not loading certs from this keychain results in differing behavior from other tools (e.g., openssl, curl, etc.). This commit changes to that so that ssl in conjunction with public key just works in such environments.

Resolves #8813

The systems root keychain contains well know root certificates,
yet is non-modifiable. As such, internal CA certificates (both root
and intermediate) tend to get installed into the systems keychain
in the context of an private organization. Not loading certs
from this keychain results in differing behavior from other tools
(e.g., openssl, curl, etc.). This commit changes to that so that
ssl in conjunction with public key just works in such environments.
Copy link
Contributor

github-actions bot commented Sep 22, 2024

CT Test Results

  2 files   17 suites   5m 29s ⏱️
285 tests 283 ✅ 2 💤 0 ❌
301 runs  299 ✅ 2 💤 0 ❌

Results for commit e461e03.

♻️ 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

@starbelly
Copy link
Contributor Author

Note that a test in the appropriate test suite has not been added, I wasn't sure how that would play out since an import call would be needed a may require a password.

To manually test this one simply needs to install a certificate into the systems keychain, startup erl, then verify the presence of the installed cert via public_key:cacerts_get/0.

@starbelly
Copy link
Contributor Author

Note that a test in the appropriate test suite has not been added, I wasn't sure how that would play out since an import call would be needed a may require a password.

To manually test this one simply needs to install a certificate into the systems keychain, startup erl, then verify the presence of the installed cert via public_key:cacerts_get/0.

Confirmed, this can not be easily tested in a suite.

@IngelaAndin IngelaAndin added the team:PS Assigned to OTP team PS label Sep 23, 2024
@dgud dgud self-assigned this Sep 23, 2024
@IngelaAndin IngelaAndin added the waiting waiting for changes/input from author label Oct 1, 2024
@dgud
Copy link
Contributor

dgud commented Nov 12, 2024

@starbelly ping

@starbelly
Copy link
Contributor Author

@starbelly ping

Apologies, I'll look at this tomorrow. Work whisked me away 😄

@starbelly
Copy link
Contributor Author

@dgud is OTP team ok with having a test that is only run when an environment variable is set? My thought here is if in a VM on github, we can import certs conditionally per an env var, this would solve the issue of not importing a cert on peoples machines when their running tests locally.

@dgud
Copy link
Contributor

dgud commented Nov 18, 2024

Should we just skip it for now, we don't have any github action tests on Darwin now, and adding tests
that are not used feels like a bad idea.

@starbelly
Copy link
Contributor Author

Should we just skip it for now, we don't have any github action tests on Darwin now, and adding tests
that are not used feels like a bad idea.

In this case I will adjust so that it doesn't result in a total failure if the systems keychain can not be read per your suggestion.

@starbelly
Copy link
Contributor Author

Should we just skip it for now, we don't have any github action tests on Darwin now, and adding tests
that are not used feels like a bad idea.

In this case I will adjust so that it doesn't result in a total failure if the systems keychain can not be read per your suggestion.

Done.

@dgud dgud added testing currently being tested, tag is used by OTP internal CI and removed waiting waiting for changes/input from author labels Nov 25, 2024
@dgud dgud merged commit 1f83f01 into erlang:maint Nov 27, 2024
24 checks passed
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 testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants