Skip to content

Commit

Permalink
Mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanochShayner committed Sep 19, 2023
1 parent 30c31c2 commit 29d056a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _get_fixes_for_file(
except ProtocolError as e:
logging.error(f'Get fixes request for file {filename} failed with response code error: {e}')
if isinstance(self.bc_integration.http, PoolManager):
self.bc_integration.http.clear() # type:ignore[no-untyped-call]
self.bc_integration.http = None
self.bc_integration.setup_http_manager(
self.bc_integration.ca_certificate,
self.bc_integration.no_cert_verify
Expand Down
8 changes: 4 additions & 4 deletions checkov/common/bridgecrew/platform_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def __init__(self) -> None:
self.enable_persist_graphs = convert_str_to_bool(os.getenv('BC_ENABLE_PERSIST_GRAPHS', 'True'))
self.persist_graphs_timeout = int(os.getenv('BC_PERSIST_GRAPHS_TIMEOUT', 60))
self.ca_certificate: str | None = None
self.no_cert_verify: str | None = None
self.no_cert_verify: bool = False

def set_bc_api_url(self, new_url: str) -> None:
self.bc_api_url = normalize_bc_url(new_url)
Expand Down Expand Up @@ -208,6 +208,9 @@ def setup_http_manager(self, ca_certificate: str | None = None, no_cert_verify:
:param ca_certificate: an optional CA bundle to be used by both libraries.
:param no_cert_verify: whether to skip SSL cert verification
"""
self.ca_certificate = ca_certificate
self.no_cert_verify = no_cert_verify

ca_certificate = ca_certificate or os.getenv('BC_CA_BUNDLE')
cert_reqs: str | None

Expand All @@ -217,8 +220,6 @@ def setup_http_manager(self, ca_certificate: str | None = None, no_cert_verify:
os.environ['REQUESTS_CA_BUNDLE'] = ca_certificate
cert_reqs = 'CERT_NONE' if no_cert_verify else 'REQUIRED'
logging.debug(f'Using CA cert {ca_certificate} and cert_reqs {cert_reqs}')
self.ca_certificate = ca_certificate
self.no_cert_verify = cert_reqs
try:
parsed_url = urllib3.util.parse_url(os.environ['https_proxy'])
self.http = urllib3.ProxyManager(os.environ['https_proxy'],
Expand All @@ -230,7 +231,6 @@ def setup_http_manager(self, ca_certificate: str | None = None, no_cert_verify:
else:
cert_reqs = 'CERT_NONE' if no_cert_verify else None
logging.debug(f'Using cert_reqs {cert_reqs}')
self.no_cert_verify = cert_reqs
try:
parsed_url = urllib3.util.parse_url(os.environ['https_proxy'])
self.http = urllib3.ProxyManager(os.environ['https_proxy'],
Expand Down

0 comments on commit 29d056a

Please sign in to comment.