Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verify args should match requests library documentation #123

Open
muscovite opened this issue Dec 16, 2024 · 2 comments
Open

verify args should match requests library documentation #123

muscovite opened this issue Dec 16, 2024 · 2 comments

Comments

@muscovite
Copy link

Docstrings for verify args throughout the taxii2client library (example) state that only a bool may be provided. However, this value is ultimately passed to the requests library, which accepts either a bool or string (source).

@chisholm
Copy link
Contributor

Looks to me like verify is passed into _HTTPConnection, which sets it on a requests session:

self.session = requests.Session()
self.session.verify = verify

The docs for that attribute are here. They don't document a string as being a supported value type.

@muscovite
Copy link
Author

Thanks for double checking!

session.request does support a string for its verify arg: https://github.com/psf/requests/blob/main/src/requests/sessions.py#L550

It looks like session.verify, set by _HTTPConnection as you point out, ends up getting used as the verify value if one wasn't passed to the session.request call:

https://github.com/psf/requests/blob/main/src/requests/sessions.py#L776

https://github.com/psf/requests/blob/main/src/requests/sessions.py#L70

(sorry, not sure how to embed code previews)

Maybe the requests documentation is out of date? I'll look into this a bit further and see an issue should be opened on their end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants