Skip to content

[ARM] Fix #19420: az bicep install: Fix the CERTIFICATE_VERIFY_FAILED for generating SSL#20183

Merged
zhoxing-ms merged 2 commits intoAzure:devfrom
wilfriedb:bicep-19420
Nov 15, 2021
Merged

[ARM] Fix #19420: az bicep install: Fix the CERTIFICATE_VERIFY_FAILED for generating SSL#20183
zhoxing-ms merged 2 commits intoAzure:devfrom
wilfriedb:bicep-19420

Conversation

@wilfriedb
Copy link
Copy Markdown
Contributor

Description
This pull request fixes issue #19420.
The old code did not pass the path to the certificate file to request.get() and urlopen(), reulting in a SSL: CERTIFICATE_VERIFY_FAILED error.

Testing Guide
On a clean developer pc behind a corporate proxy with a certificate signed by a private root CA, type on a pwsh prompt:
az bicep install
Result:
bicep will be installed
(without the fix, there would be a certificate error)

On a clean regular developer pc, do the same, type
az bicep install
bicep will be installed, just as before the fix.

History Notes
[Bicep] az bicep install: works now behind a corporate proxy

@ghost ghost added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Nov 3, 2021
@ghost
Copy link
Copy Markdown

ghost commented Nov 3, 2021

Thank you for your contribution wilfriedb! We will review the pull request and get back to you soon.

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Nov 3, 2021

Bicep

@yonzhan yonzhan added this to the Nov 2021 (2021-12-07) milestone Nov 3, 2021
@zhoxing-ms zhoxing-ms changed the title [Bicep] Fix for issue #19420 az bicep install SSL: CERTIFICATE_VERIFY_FAILED error [ARM] Fix #19420: az bicep install: Fix the CERTIFICATE_VERIFY_FAILED for Installation of SSL Nov 15, 2021
@zhoxing-ms zhoxing-ms changed the title [ARM] Fix #19420: az bicep install: Fix the CERTIFICATE_VERIFY_FAILED for Installation of SSL [ARM] Fix #19420: az bicep install: Fix the CERTIFICATE_VERIFY_FAILED for generating SSL Nov 15, 2021
Comment on lines +144 to +145
ca_file = certifi.where()
response = requests.get("https://aka.ms/BicepReleases", verify=ca_file)
Copy link
Copy Markdown
Member

@jiasli jiasli Mar 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This make requests only use certifi.where(). Env var REQUESTS_CA_BUNDLE and CURL_CA_BUNDLE no longer take effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants