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

fix: make Client(insecure=True) affect login & logout #384

Merged
merged 3 commits into from
Sep 6, 2023

Conversation

oleobal
Copy link
Contributor

@oleobal oleobal commented Sep 4, 2023

Summary

Currently instantiating a Client with insecure=True (which disables SSL verification) will still fail you at login if you have an invalid TLS certificate. This fixes that.

Please check if the PR fulfills these requirements

  • If necessary, the changelog has been updated
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • The commit message follows the conventional commit specification
  • For any breaking changes, companion PRs have been opened on the following repositories:

@oleobal oleobal marked this pull request as ready for review September 6, 2023 08:14
@oleobal oleobal requested a review from a team as a code owner September 6, 2023 08:14
Copy link
Contributor

@SdgJlbl SdgJlbl left a comment

Choose a reason for hiding this comment

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

Thanks for the PR 🙏
Do you think we can add a small, non-regression unit test?

@oleobal
Copy link
Contributor Author

oleobal commented Sep 6, 2023

@SdgJlbl

Do you think we can add a small, non-regression unit test?

I'm not sure how to test this, do you know how I can test connecting to a target with a self-signed certificate?

@oleobal oleobal changed the title fix: make Client(insecure=True) to affect login & logout fix: make Client(insecure=True) affect login & logout Sep 6, 2023
@SdgJlbl
Copy link
Contributor

SdgJlbl commented Sep 6, 2023

@SdgJlbl

Do you think we can add a small, non-regression unit test?

I'm not sure how to test this, do you know how I can test connecting to a target with a self-signed certificate?

I think I would mock the call to requests.post and check that the arguments are what I expect.

It's not ideal and mocking and all, but at least it will raises if someone forgets to keep all the kwargs in a future refactoring.

Signed-off-by: Olivier Léobal <[email protected]>
Copy link
Contributor

@SdgJlbl SdgJlbl left a comment

Choose a reason for hiding this comment

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

Thanks

@oleobal oleobal merged commit b592a13 into main Sep 6, 2023
5 checks passed
@oleobal oleobal deleted the fix/insecure-login branch September 6, 2023 13:47
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.

2 participants