用于letsencrypt的certbot缺lesspyopenssl模块

我需要帮助为LetsEncrypt设置CertBot

我在Python 2.7上运行CentOS 7

当我运行certbot时出现以下错误:

[root@li86-193 frappe-bench]#certbot certonly --manual Traceback (most recent call last): File "/usr/bin/certbot", line 7, in <module> from certbot.main import main File "/usr/lib/python2.7/site-packages/certbot/main.py", line 21, in <module> from certbot import client File "/usr/lib/python2.7/site-packages/certbot/client.py", line 10, in <module> from acme import client as acme_client File "/usr/lib/python2.7/site-packages/acme/client.py", line 31, in <module> requests.packages.urllib3.contrib.pyopenssl.inject_into_urllib3() File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 112, in inject_into_urllib3 _validate_dependencies_met() File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 147, in _validate_dependencies_met raise ImportError("'pyOpenSSL' module missing required functionality. " ImportError: 'pyOpenSSL' module missing required functionality. Try upgrading to v0.14 or newer. [root@li86-193 frappe-bench]# pip show certbot Name: certbot Version: 0.11.1 Summary: ACME client Home-page: https://github.com/letsencrypt/letsencrypt Author: Certbot Project Author-email: [email protected] License: Apache License 2.0 Location: /usr/lib/python2.7/site-packages Requires: ConfigArgParse, configobj, zope.component, pytz, setuptools, cryptography, zope.interface, pyrfc3339, mock, parsedatetime, six, acme, PyOpenSSL [root@li86-193 frappe-bench]# pip show pyopenssl Name: pyOpenSSL Version: 16.2.0 Summary: Python wrapper module around the OpenSSL library Home-page: https://pyopenssl.readthedocs.io/ Author: Hynek Schlawack Author-email: [email protected] License: Apache License, Version 2.0 Location: /usr/lib/python2.7/site-packages Requires: six, cryptography 

请帮忙

谢谢

不要尝试在CentOS / RHEL系统上手动安装certbot。 这只是一个巨大的混乱。 相反,从EPEL安装它。

 yum install epel-release yum install certbot 

这似乎是为我工作。

从这里抓取一个rpm: http : //rpm.pbone.net/index.php3/stat/4/idpl/31446026/dir/centos_7/com/pyOpenSSL-0.15.1-1.el7.noarch.rpm.html

 wget ftp://ftp.muug.mb.ca/mirror/centos/7.2.1511/cloud/x86_64/openstack-mitaka/common/pyOpenSSL-0.15.1-1.el7.noarch.rpm sudo rpm -Uvh pyOpenSSL-0.15.1-1.el7.noarch.rpm sudo yum install certbot 

我在0.9.3中遇到了同样的问题。 这是由安装nginx插件引起的。

您可以轻松地重现一个工作安装:

docker run -it –rm centos:centos7 bash yum -y install epel-release yum -y install certbot certbot -h

我遇到了同样的问题。 使用python venv我能够使用pip获得certbot的工作。

步骤:安装virtualenv

 pip install virtualenv --upgrade 

创build一个virtualenv

 virtualenv -p /usr/bin/python2.7 certbot 

激活certbot virtualenv

 . /root/certbot/bin/activate 

你的提示可能会变成这样的东西

(certbot) [root@hostname ~]#

然后点安装certbot

 pip install certbot 

完成后,您可以在certbot virtualenv下testingcertbot命令,但是如果您要使用cron来安装certbot续订,则这是不实际的。 所以停用虚拟环境,

 (certbot) [root@hostname ~]# deactivate 

现在运行certbot命令

 /root/certbot/bin/certbot 

只是通过运行使其工作

 sudo pip install pyOpenSSL==0.14.0 

它删除了0.13版本并安装了0.14,然后certbot正常工作。

看来,epel源的版本太旧了,你可以删除yum版本的certbot,然后用pip来安装它

在过去的两个月中,我在两个独立的Centos7系统上两次经历了同样的问题。 这对我来说是有效的:

  • yum删除pyOpenSSL [这将删除通过epel安装的certbot]
  • yum install openssl-devel python-devel [可能实际上可能不需要]
  • pip安装certbot
  • pip安装certbot-apache

完成这些步骤后,我能够用certbot成功更新我的证书。

pip install pyOpenSSL == 0.14.0 mv /usr/lib64/python2.7/site-packages/OpenSSL /usr/lib64/python2.7/site-packages/pyOpenSSL

相反certbot,letsencrypt客户端解决了我的问题。

您可以删除其他客户端

 pip uninstall certbot pip uninstall pyopenssl 

然后安装letsencrypt:

 pip install letsencrypt