Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/azure-cli-core/azure/cli/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@
CLI_PACKAGE_NAME = 'azure-cli'
COMPONENT_PREFIX = 'azure-cli-'

SSLERROR_TEMPLATE = ('Certificate verification failed. This typically happens when using Azure CLI behind a proxy '
'that intercepts traffic with a self-signed certificate. '
# pylint: disable=line-too-long
'Please add this certificate to the trusted CA bundle. More info: https://docs.microsoft.com/cli/azure/use-cli-effectively#work-behind-a-proxy.')
SSLERROR_TEMPLATE = ('An SSL error occurred. This typically happens when using Azure CLI behind a proxy or firewall. '
'For more information, see: '
'https://learn.microsoft.com/cli/azure/use-cli-effectively#work-behind-a-proxy')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we distinguish the firewall error and certificate error further based on error message?

The certificate error is Caused by SSLError(SSLCertVerificationError.
The firewall error is Caused by SSLError(SSLEOFError. In this case, we can suggest users adding endpoints to allowlist: https://learn.microsoft.com/en-us/cli/azure/azure-cli-endpoints?tabs=azure-cloud

Copy link
Copy Markdown
Member Author

@jiasli jiasli Nov 24, 2023

Choose a reason for hiding this comment

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

To some extent, firewall is a special type of proxy. I think we can elaborate it in the doc, but keep the error message simple.

Also, I think SSLEOFError is only one type of SSLError caused by firewall. There may be other firewalls out there causing other SSLErrors. Capturing the base SSLError covers more scenarios.


QUERY_REFERENCE = ("To learn more about --query, please visit: "
"'https://docs.microsoft.com/cli/azure/query-azure-cli'")
Expand Down
Loading