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

Let public_key.cacerts_load loads user-trusted certificates on macOS #6871

Closed
pvthuyen opened this issue Feb 16, 2023 · 7 comments
Closed

Let public_key.cacerts_load loads user-trusted certificates on macOS #6871

pvthuyen opened this issue Feb 16, 2023 · 7 comments
Assignees
Labels
enhancement team:PS Assigned to OTP team PS

Comments

@pvthuyen
Copy link

pvthuyen commented Feb 16, 2023

As the moment, cacerts_load only load certificates from the OS location, i.e. /System/Library/Keychains/SystemRootCertificates.keychain. This lefts out the user-trusted certificates in /Library/Keychains/System.keychain

Describe the solution you'd like
Load certificates from /Library/Keychains/System.keychain in cacerts_load too.

@rickard-green rickard-green added the team:PS Assigned to OTP team PS label Feb 20, 2023
@dgud
Copy link
Contributor

dgud commented Mar 30, 2023

I don't know if this is a good idea, the idea here was that it loads os only provided certs and that you can use public_key:cacerts_load/1 if you want it be handled differently.

@pvthuyen
Copy link
Author

Certificates stored in /Library/Keychains/System.keychain are also parts of System Keychain [1]. I think they should be considered as OS provided certs too. Using public_key:cacerts_load/1 is not a possible option for me either as it does not support passing in a .keychain file.

@dgud
Copy link
Contributor

dgud commented Mar 31, 2023

We don't read the files directly on macOS, see https://github.com/erlang/otp/blob/master/lib/public_key/src/pubkey_os_cacerts.erl#L133
you could do the same and write the results to a temporary file and load for now.

@pvthuyen
Copy link
Author

Thank you. Can we still consider loading the certs from System Keychain too? User added certificates are stilled being used as OS provided certs for other apps and I think it should be the same case here.

@dgud
Copy link
Contributor

dgud commented May 2, 2023

I'm closing this for now.

@dgud dgud closed this as completed May 2, 2023
@randysecrist
Copy link

bump on this -> on the mac the system keychain is where most corps dump their certs

@dgud
Copy link
Contributor

dgud commented Sep 30, 2024

See #8844

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement team:PS Assigned to OTP team PS
Projects
None yet
Development

No branches or pull requests

4 participants