Skip to content

Use the session's verify when it is not passed explicitly#505

Open
allburov wants to merge 1 commit into
masterfrom
fix/session-verify
Open

Use the session's verify when it is not passed explicitly#505
allburov wants to merge 1 commit into
masterfrom
fix/session-verify

Conversation

@allburov

Copy link
Copy Markdown
Member

Fixes #500.

Passing a session with TLS verification disabled had no effect:

session = requests.Session()
session.verify = False
path = ArtifactoryPath("https://artifactory.local/artifactory/repo", session=session)
# requests were still made with verify=True

ArtifactoryPath defaulted verify to True and passed it to every request explicitly. Requests gives a request-level argument precedence over the session's own setting, so session.verify was always discarded.

Now verify falls back to the session when it is not given, in both constructors. The precedence becomes: explicit verify= → config file entry → session.verifyTrue. Callers who pass no session are unaffected, and a session that never set verify still yields True, since that is the default in requests.

Patreon Boosty

@allburov
allburov requested a review from beliaev-maksim July 14, 2026 12:04

@beliaev-maksim beliaev-maksim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks!
lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Session 'verify' attribute should override default verify value when constructing ArtifactPath

2 participants