m-click / requests_pkcs12

Add PKCS#12 support to the Python requests library in a clean way, without monkey patching or temporary files
ISC License
124 stars 33 forks source link

urllib3 version minimum #36

Closed jessica-writes-code closed 1 year ago

jessica-writes-code commented 1 year ago

The following packages and versions are a valid environment set-up, given the current dependencies in requests_pkcs12 and its dependencies.

certifi==2022.12.7
cffi==1.15.1
charset-normalizer==2.0.12
cryptography==39.0.0
idna==3.4
pycparser==2.21
pyOpenSSL==23.0.0
requests==2.28.1
requests-pkcs12==1.14
urllib3==1.26.0

However, this environment results in the following error, when one tries to import requests_pkcs12.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jessicamoore/Documents/PythonEnvs/test-requestspkcs12/lib/python3.10/site-packages/requests_pkcs12.py", line 30, in <module>
    import urllib3.contrib.pyopenssl
  File "/Users/jessicamoore/Documents/PythonEnvs/test-requestspkcs12/lib/python3.10/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 easiest solution seems to be adding a minimum version of urllib3 (>=1.26.13).

vog commented 1 year ago

Thanks a lot for your pull request to fix this issue!

We just released version 1.15 that contains your fix: