'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

1,360 阅读1分钟

在linux系统上运行python程序时,报了这个错误

解决方法:

  1. 修改/usr/lib/python3/dist-packages/OpenSSL/crypto.py文件里面的:

注释CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK

  1. 删掉当前版本的cryptography:

pip uninstall cryptography

  1. 安装兼容版本的cryptography:

pip install --upgrade cryptography==36.0.2