Skip to content

Commit

Permalink
Fix the fallback logic for tls verification
Browse files Browse the repository at this point in the history
If no PULP_CA_BUNDLE is provided, but validte_certs is set, we should
pass True to requests session.verify.

(cherry picked from commit 6a51241)
  • Loading branch information
mdellweg committed May 22, 2024
1 parent 7611fc0 commit 4488f8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/pulp-glue/+ca_defaults.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed the logic to use requests defaults for tls verification.
4 changes: 2 additions & 2 deletions pulp-glue/pulp_glue/common/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ def __init__(
self._session.headers.update(headers)
self._session.max_redirects = 0

verify: t.Optional[t.Union[bool, str]] = (
os.environ.get("PULP_CA_BUNDLE") if validate_certs is not False else False
verify: t.Optional[t.Union[bool, str]] = validate_certs and os.environ.get(
"PULP_CA_BUNDLE", True
)
session_settings = self._session.merge_environment_settings(
base_url, {}, None, verify, None
Expand Down

0 comments on commit 4488f8e

Please sign in to comment.