-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Core] Add truststore
library so System certificates are trusted automatically
#30468
base: dev
Are you sure you want to change the base?
Conversation
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
Validation for Breaking Change Starting...
Thanks for your contribution! |
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
Thank you for your contribution timja! We will review the pull request and get back to you soon. |
This seems to be a proper way to handle CA cert verification failure, but the newly added lib truststore requires Python 3.10+, while azure-cli still supports Python 3.9, cc @jiasli |
@@ -1027,6 +1028,7 @@ def send_raw_request(cli_ctx, method, url, headers=None, uri_parameters=None, # | |||
|
|||
# https://requests.readthedocs.io/en/latest/user/advanced/#prepared-requests | |||
s = Session() | |||
s.mount(url, SSLContextAdapter()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applying SSLContextAdapter
in send_raw_request()
will only affect az rest
. All other commands that use Azure Python SDK will not benefit from this change. MSAL is not affected either.
There is a similar feature request AzureAD/microsoft-authentication-library-for-python#685 for supporting using certificates from system certificate store for service principal authentication.
Thanks for the contribution, but we currently don't have a plan to support system certificate store (#19305). |
Related command
core
Description
Fixes #28050
Fixes #26456
Fixes #29948
Testing Guide
Run az commands when behind a MitM proxy with the certificates in a trusted OS store and without setting the
REQUESTS_CA_BUNDLE
environment valuee.g. I've been using:
Before:
After:
History Notes
[Core] Add
truststore
library so System certificates are trusted automaticallyThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.