Issue
During the license data updating rhn_check command shows the error below:
/usr/lib/python3.6/site-packages/OpenSSL/crypto.py:12: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography (40.0) will be the last to support Python 3.6.
from cryptography import x509
Traceback (most recent call last):
File "/usr/sbin/rhn_check", line 44, in <module>
import OpenSSL
File "/usr/lib/python3.6/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "/usr/lib/python3.6/site-packages/OpenSSL/crypto.py", line 1553, in <module>
class X509StoreFlags(object):
File "/usr/lib/python3.6/site-packages/OpenSSL/crypto.py", line 1573, in X509StoreFlags
CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'
Environment
- CloudLinux OS 8
Solution
Check the cryptography
version for Python 3.6:
/usr/bin/pip3.6 show cryptography
The output should be (Version: 3.2.1
):
# /usr/bin/pip3.6 show cryptography
Name: cryptography
Version: 3.2.1
Summary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.
Home-page: https://github.com/pyca/cryptography
Author: The cryptography developers
Author-email: cryptography-dev@python.org
License: BSD or Apache License, Version 2.0
Location: /usr/lib64/python3.6/site-packages
Requires: six, cffi
#
If the output is different, like:
# /usr/bin/pip3.6 show cryptography
Name: cryptography
Version: 39.0.0
Set the Version: 3.2.1
version:
# /usr/bin/pip3.6 install cryptography==3.2.1
And run rhn_check again. The output should be empty.
If it shows version 3.9:
Requirement already satisfied: cryptography==3.2.1 in /usr/local/lib64/python3.9/site-packages (3.2.1)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in /usr/local/lib64/python3.9/site-packages (from cryptography==3.2.1) (1.17.0)
Requirement already satisfied: six>=1.4.1 in /usr/local/lib/python3.9/site-packages (from cryptography==3.2.1) (1.17.0)
Requirement already satisfied: pycparser in /usr/local/lib/python3.9/site-packages (from cffi!=1.11.3,>=1.8->cryptography==3.2.1) (2.22)
try
yum remove python39*
and then
# /usr/bin/pip3.6 install cryptography==3.2.1
The same is for cffi:
# /usr/bin/pip3.6 uninstall cffi
# /usr/bin/pip3.6 install cffi==1.12
Re-register the server
# rhnreg_ks --activationkey=the key --force
# yum update
Cause
Incorrect cryptography
module version for Python 3.6.
Comments
0 comments
Please sign in to leave a comment.