15
rated 0 times
[
15]
[
0]
/ answers: 1 / hits: 57101
/ 3 Years ago, wed, august 25, 2021, 9:43:30
I was using python 3.6 on my ubuntu machine and faced this error when doing some testing:
CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
...
from OpenSSL import crypto, SSL
default: File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1550, in <module>
default: class X509StoreFlags(object):
default: File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1570, in X509StoreFlags
default: CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
default: AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'
Did research on the error. So I installed python 3.9 and then update alternatives to assign python 3.9 as the main python to use. Then I reinstall and upgrade OpenSSL and Cryptography.
sudo pip3 install pyOpenSSL --upgrade
sudo pip3 install cryptography --upgrade
I run my testing again and still face the same error.
I decided to check the python3.9 dist-packages folder (/usr/local/lib/python3.9/dist-packages/) and realise that OpenSSL and Cryptography are nowhere to be found. They are found in /usr/local/lib/python3.6/dist-packages/ instead. Could this be why the error persist?
More From » openssl