sethmlarson / truststore

Verify certificates using OS trust stores
https://truststore.readthedocs.io
MIT License
151 stars 18 forks source link

Add support for PyPy 3.10 #113

Closed sethmlarson closed 1 year ago

sethmlarson commented 1 year ago

This is very much a hack, I don't like it, but attempting to add support to PyPy while maintaining the SSLContext subclassing is a huge pain from my initial attempt. The __class__ hack maintains compatibility for aiohttp and trustme.

Closes #112

davisagli commented 1 year ago

Oh my. Mostly I'm just impressed if it works. Good call on only changing it for non-CPython implementations, in case someone is already using isinstance to check if they've got our SSLContext.

I'll wait for final review until the tests pass.

sethmlarson commented 1 year ago

Looks like a bug in PyPy's SSLContext.load_cert_chain() function, they're not accepting PosixPath objects. Unfortunately their GitLab instance appears to be offline right now. I guess I'll check later?

sethmlarson commented 1 year ago

Okay @davisagli tests are passing so ready for review. If you'd like to take a stab at PyPy support without the horrible hacks please do, I would like to not have them :sweat:

mattip commented 11 months ago

Thanks for getting PyPy to work. I am not familiar with the project, but am a PyPy core dev. Please ping me (mattip) if you come across any other PyPy problems.

mattip commented 11 months ago

I opened https://foss.heptapod.net/pypy/pypy/-/issues/4002 to continue the discussion.

sethmlarson commented 11 months ago

@mattip Thanks Matti! We'll keep you in mind if we run into future problems :)