Skip to content

Commit

Permalink
Merge pull request #153 from SUSE-Enceladus/silence-insecure-request
Browse files Browse the repository at this point in the history
Disable insecure request warning
  • Loading branch information
rjschwei committed May 20, 2024
2 parents 7492190 + 38544b2 commit d91381c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/cloudregister/registerutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
REGISTERED_SMT_SERVER_DATA_FILE_NAME = 'currentSMTInfo.obj'
RMT_AS_SCC_PROXY_MARKER = 'rmt_is_scc_proxy'

requests.packages.urllib3.disable_warnings(
requests.packages.urllib3.exceptions.InsecureRequestWarning
)


# ----------------------------------------------------------------------------
def add_hosts_entry(smt_server):
Expand Down Expand Up @@ -508,9 +512,6 @@ def get_credentials(credentials_file):
# ----------------------------------------------------------------------------
def refresh_registry_credentials():
"""Refresh registry credentials."""
# to silence InsecureRequestWarning
# should be fixed on a different PR
requests.packages.urllib3.disable_warnings()
return get_activations()


Expand Down
5 changes: 5 additions & 0 deletions lib/cloudregister/smt.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ def __init__(self, smtXMLNode, https_only=False):
if https_only:
self._protocol = 'https'
self._check_urls = self._form_srv_check_urls()
# disable InsecureRequestWarning
# as verification is disabled for the https request
requests.packages.urllib3.disable_warnings(
requests.packages.urllib3.exceptions.InsecureRequestWarning
)

# --------------------------------------------------------------------
def __eq__(self, other_smt):
Expand Down

0 comments on commit d91381c

Please sign in to comment.