-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Allow azure-cli to trust on OS certificates #28050
Comments
Thank you for opening this issue, we will look into it. |
Looking through the source code of
For the latter, you should be able to export all CA certificates from Apple KeyChain into a single PEM bundle If the Azure CLI team were to implement a The problem with passing arguments to commands for this purpose is that it really depends on the environment. On some environments you do want to trust OS certificates, on others you don't. This adds complexity into your scripts because now you need to do additional In the end of the day, you need to ask yourself |
HI @codepic. Thanks for the update. |
@jiasli, looking at the issue you pointed, it seems there is now what seems to be a simple(r) way to address this without waiting for requests (sorry if I am oversimplifying :)), but using
I understand it might not be so simple to make a change in a core are as this, but... Worth trying to ask for this to be considered, especially due to the upside for the community of azure-cli users. |
There's an another option. In fact two options.
The caveat of truststore is the monkeypatching of the stdlib and that it is exclusive to Python 3.10+ |
The referenced issue with requests is now closed as completed, with the resolution being the recommendation to use @jiasli could we evaluate conditionally adding/importing truststore. For most systems on python 3.10+, this should solve the issue with a better user experience then messing with the bundled certs. For systems where truststore does not work (python 3.9 or old versions of macos), then the conditional import should not affect preset behavior. |
Related command
any command (prob REQUESTS_CA_BUNDLE is the closest)
Is your feature request related to a problem? Please describe.
Yes. Enabling azure-cli to work with custom trusted cert roots.
On macOS it is not simple to configure https://learn.microsoft.com/en-us/cli/azure/use-cli-effectively?tabs=bash%2Cbash2#work-behind-a-proxy as:
/usr/local/Cellar/azure-cli/<cliversion>/libexec/lib/python<version>/site-packages/certifi/cacert.pem
)Describe the solution you'd like
Allow azure-cli to trust the certificates that are trusted by the OS (keychain on macOS, others on other OS).
This could be the default behaviour or, in order to keep compat with current behaviour, allow enabling it via both env var (such as
CA_BUNDLE_TRUST_OS
) and CLI option (--ca-bundle-trust-os
)Alternatively (or in conjuntcion), allow specification of an additional bundle vi both env var (such as
REQUESTS_CA_BUNDLE_EXTRA
) and CLI option (--requests-ca-bundle-extra
)Describe alternatives you've considered
Implementing bash scripts that need to try to guess the correct location to place new certs, generate a new bundle, and then rewriting.
Additional context
The text was updated successfully, but these errors were encountered: