Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions src/azure-cli-core/azure/cli/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1164,12 +1164,6 @@ def __exit__(self, exc_type, exc_val, exc_tb):


def _ssl_context():
if sys.version_info < (3, 4) or (in_cloud_console() and platform.system() == 'Windows'):
try:
return ssl.SSLContext(ssl.PROTOCOL_TLS) # added in python 2.7.13 and 3.6
except AttributeError:
return ssl.SSLContext(ssl.PROTOCOL_TLSv1)

return ssl.create_default_context()


Expand Down
10 changes: 1 addition & 9 deletions src/azure-cli/azure/cli/command_modules/acr/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from knack.util import CLIError
from knack.log import get_logger

from azure.cli.core.util import in_cloud_console, user_confirmation
from azure.cli.core.util import user_confirmation

from ._docker_utils import (
get_access_credentials,
Expand Down Expand Up @@ -366,15 +366,7 @@ def _get_helm_package_name(client_version):


def _ssl_context():
import sys
import ssl

if sys.version_info < (3, 4) or (in_cloud_console() and platform.system() == 'Windows'):
try:
return ssl.SSLContext(ssl.PROTOCOL_TLS) # added in python 2.7.13 and 3.6
except AttributeError:
return ssl.SSLContext(ssl.PROTOCOL_TLSv1)

return ssl.create_default_context()


Expand Down
7 changes: 0 additions & 7 deletions src/azure-cli/azure/cli/command_modules/acs/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2218,13 +2218,6 @@ def k8s_install_kubelogin(cmd, client_version='latest', install_location=None, s


def _ssl_context():
if sys.version_info < (3, 4) or (in_cloud_console() and platform.system() == 'Windows'):
try:
# added in python 2.7.13 and 3.6
return ssl.SSLContext(ssl.PROTOCOL_TLS)
except AttributeError:
return ssl.SSLContext(ssl.PROTOCOL_TLSv1)

return ssl.create_default_context()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.cli.core.commands import LongRunningOperation
from azure.cli.core.util import in_cloud_console, shell_safe_json_parse, open_page_in_browser, get_json_object, \
from azure.cli.core.util import shell_safe_json_parse, open_page_in_browser, get_json_object, \
ConfiguredDefaultSetter, sdk_no_wait
from azure.cli.core.util import get_az_user_agent, send_raw_request, get_file_json
from azure.cli.core.profiles import ResourceType, get_sdk
Expand Down Expand Up @@ -2676,12 +2676,6 @@ def _redact_storage_accounts(properties):


def _ssl_context():
if sys.version_info < (3, 4) or (in_cloud_console() and sys.platform.system() == 'Windows'):
try:
return ssl.SSLContext(ssl.PROTOCOL_TLS) # added in python 2.7.13 and 3.6
except AttributeError:
return ssl.SSLContext(ssl.PROTOCOL_TLSv1)

return ssl.create_default_context()


Expand Down
Loading