pyca/pyopenssl

pyOpenSSL version 23.0.0 does not work with recent cryptography 39.0.0

sbernatsky opened this issue ยท 5 comments

In recent version of cryptography (39.0.0) the x509 module was removed. This results in ModuleNotFoundError:

  File "~/shared/venv/lib/python3.9/site-packages/urllib3/contrib/pyopenssl.py", line 53, in <module>
    from cryptography.hazmat.backends.openssl.x509 import _Certificate
ModuleNotFoundError: No module named 'cryptography.hazmat.backends.openssl.x509'

The problem is with the way how releases are pinned against cryptography major versions to prevent future breakage.
It should be cryptography [required: >=38.0.0,<39] instead of current cryptography [required: >=38.0.0,<40].

alex commented

My fault. Saw pyopenssl.py and decided it is in pyopenssl library. After updating urllib3 to the recent version all is fine.

Please close this issue.

alex commented

Glad you found a resolution.

Better for now is:

pip install pyopenssl==22.1.0 works fine!

@fredmanre thank you!