[Core] Add truststore library so System certificates are trusted automatically#30468
[Core] Add truststore library so System certificates are trusted automatically#30468timja wants to merge 1 commit into
truststore library so System certificates are trusted automatically#30468Conversation
|
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 |
|
|
||
| # https://requests.readthedocs.io/en/latest/user/advanced/#prepared-requests | ||
| s = Session() | ||
| s.mount(url, SSLContextAdapter()) |
There was a problem hiding this comment.
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_BUNDLEenvironment valuee.g. I've been using:
Before:
After:
History Notes
[Core] Add
truststorelibrary 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.