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

AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK' #1114

Closed
mvellasco opened this issue Apr 26, 2022 · 6 comments
Closed

Comments

@mvellasco
Copy link

Importing the crypto module from OpenSSL throws an AttributeError. This is happening under version 20.0.1 of the library.

File "/usr/local/lib/python3.8/site-packages/OpenSSL/__init__.py", line 8, in <module>
  from OpenSSL import crypto, SSL
File "/usr/local/lib/python3.8/site-packages/OpenSSL/crypto.py", line 1556, in <module>
     class X509StoreFlags(object):
File "/usr/local/lib/python3.8/site-packages/OpenSSL/crypto.py", line 1577, in X509StoreFlags
     CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'
@alex
Copy link
Member

alex commented Apr 26, 2022

Can you provide instructinos for reproducing this from a clean environment?

I strongly suspect you are mixing incompatible versions of pyOpenSSL and cryptography and one/both of them should be upgraded.

@mvellasco
Copy link
Author

Doing pip install pyopenssl==20.0.1 alone and them going to the terminal and trying the import above gives the error for me. I'll check my version of cryptography as well to see if that's the issue.

@alex
Copy link
Member

alex commented Apr 26, 2022

You'll need to use a more recent pyopenssl version, or pin to an older cryptography version.

@mvellasco
Copy link
Author

Downgrading cryptography worked like a charm. Thank you very much @alex !

@reaperhulk
Copy link
Member

For those seeing this issue: You can upgrade pyOpenSSL to latest to resolve it or downgrade cryptography, but the latter is not a good long term solution since you will (of course) not receive security updates.

@reaperhulk
Copy link
Member

We re-added some symbols in 37.0.1 to minimize breakage. We still encourage users to upgrade to the latest pyOpenSSL as these will be removed again in a future release.

@reaperhulk reaperhulk unpinned this issue Apr 27, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants