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

Propagate verify=False from session to requests #387

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

phinds1
Copy link

@phinds1 phinds1 commented Mar 4, 2024

@lucagiove
Copy link
Member

@phinds1 would be very useful a test that shows the bug and your PR that fixes the test.
This would speedup merging, otherwise I need to do it on my own.

@phinds1
Copy link
Author

phinds1 commented May 13, 2024

Are there unit tests somewhere? Or integration test framework that could have a broken SSL server added?

I didn't add a feature, its just a bug fix, so there should be no more or less test coverage.

@lucagiove
Copy link
Member

An integration test is quite hard to develop in this case, I've on my list.
What could be done is an unit test to show the case where verify is not propagated properly.
It's not a matter of coverage but more a matter of process if a bug exists than a failing test can be written and then fixed.

@@ -34,6 +34,8 @@ def _common_request(

self._capture_output()

kwargs.update({'verify': session.verify})
Copy link
Contributor

Choose a reason for hiding this comment

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

This will break session less keywords (session is not defined in this case), and should not be necessary when the session has verify=False

@PaulBrandUWV
Copy link
Contributor

PaulBrandUWV commented May 27, 2024

I just tested this and it works as expected. Create session keyword by default sets verify to False

*** Settings ***
Library     RequestsLibrary

*** Variables ***
${url}    https://wrong.host.badssl.com/

*** Test Cases ***
Unverified GET on session request
    Create Session    test_session    ${url}
    GET on Session    test_session    /

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

Successfully merging this pull request may close these issues.

3 participants