fix: handle SSL certificate verification failures in curl install script (closes #28044) - #33888
Conversation
|
Hi MORDEHAI BOTBIKA (@botbikamordehai2-sketch), |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Thank you for your contribution MORDEHAI BOTBIKA (@botbikamordehai2-sketch)! We will review the pull request and get back to you soon. |
|
MORDEHAI BOTBIKA (@botbikamordehai2-sketch) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
|
bicep |
What
Fix issue #28044 where
az bicep installfails withSSLCertVerificationErrorwhen downloading from aka.ms. The root cause is that theurlopencalls in the install script do not respect the system's trusted CA certificates, especially on Windows with corporate proxies or security software that inject self-signed certificates.Fix
The script now creates an SSL context using
ssl.create_default_context(), which uses the system's default CA bundle. If that fails or is incomplete (e.g., on some Windows setups), it falls back to using thecertifipackage's CA bundle if available. As a last resort, it can be run with--insecure-like behavior by setting an environment variableAZURE_CLI_DISABLE_SSL_VERIFICATION(not enabled by default). This change ensures the script can download necessary files even when a self-signed certificate is in the chain, while preserving security when possible.Closes #28044