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

SSLContext recursion error strikes again (potential bug as well) #143

Closed
cmin764 opened this issue Jul 3, 2024 · 2 comments
Closed

SSLContext recursion error strikes again (potential bug as well) #143

cmin764 opened this issue Jul 3, 2024 · 2 comments

Comments

@cmin764
Copy link

cmin764 commented Jul 3, 2024

Related to this older Issue, we started to encounter this problem through our robocorp libraries (where injection gets done -- so at CLI level, not library) and now I observe it even in our CI during the test runs. (while I couldn't reproduce locally on the same system and Python version)

  1. Question is, did something change in the ssl.py so that this started to appear with the later Py3.10.x versions?
  2. And why is the super class invoked like this: _original_super_SSLContext = super(_original_SSLContext, _original_SSLContext)? Even in the standard ssl module I see the same pattern when calling the verify_mode method. By looking at the docs we have the following:

    super(type, type2) -> bound super object; requires issubclass(type2, type)

    @verify_mode.setter
    def verify_mode(self, value):
        super(SSLContext, SSLContext).verify_mode.__set__(self, value)
    L.E.: That's all good, as expected. (as we get the super class of the first argument while passing the second for change)
  3. Don't we have a bug here with this code (_api.py)?
    @verify_flags.setter
    def verify_flags(self, value: ssl.VerifyFlags) -> None:
        _original_super_SSLContext.verify_flags.__set__(  # type: ignore[attr-defined]
            self._ctx, value
        )
    as clearly we don't have .verify_flags available with PyPI.
@JonasR
Copy link

JonasR commented Jul 5, 2024

We are seeing the same issue when using truststore with requests and talking to some APIs, but not others. Haven't figured out yet what the determining factor is really.

However, it works if I pin requests = "==2.31.0" even with truststore = "==0.9.0", so maybe more of a requests bug? Related to psf/requests#6731?

@sethmlarson
Copy link
Owner

Yeah this seems like a Requests bug, unfortunately. Going to close this issue.

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

3 participants