Letsencrypt无法生成、更新SSL证书的解决办法

我在CentOS服务器上统一使用Letsencrypt来管理(创建和更新)网站的https证书。

我使用的是阿里云的服务器,首次使用Letsencrypt创建https证书时一切正常,当证书到期后,使用renew命令无法更新证书;,具体如下:
 

Upgrading certbot-auto 0.32.0 to 0.35.1...
Replacing certbot-auto...
Creating virtual environment...
Installing Python packages...
Had a problem while installing Python packages.

pip prints the following errors: 
=====================================================
Ignoring enum34: markers 'python_version < "3.4"' don't match your environment
Collecting ConfigArgParse==0.14.0 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 7))
  Downloading http://pypi.doubanio.com/packages/55/ea/f0ade52790bcd687127a302b26c1663bf2e0f23210d5281dbfcd1dfcda28/ConfigArgParse-0.14.0.tar.gz
Collecting asn1crypto==0.24.0 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 9))
  Downloading http://pypi.doubanio.com/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl (101kB)
Collecting certifi==2019.3.9 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 12))
  Downloading http://pypi.doubanio.com/packages/60/75/f692a584e85b7eaba0e03827b3d51f45f571c2e793dd731e598828d380aa/certifi-2019.3.9-py2.py3-none-any.whl (158kB)
Collecting cffi==1.12.2 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 15))
  Downloading http://pypi.doubanio.com/packages/7a/0e/c14aeb7a8c73ddd60cb318ada44c4a4a6d1c29666759921584f269a95b07/cffi-1.12.2-cp34-cp34m-manylinux1_x86_64.whl (428kB)
Collecting chardet==3.0.4 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 44))
  Downloading http://pypi.doubanio.com/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
Collecting configobj==5.0.6 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 47))
  Downloading http://pypi.doubanio.com/packages/64/61/079eb60459c44929e684fa7d9e2fdca403f67d64dd9dbac27296be2e0fab/configobj-5.0.6.tar.gz
Collecting cryptography==2.6.1 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 49))
  Downloading http://pypi.doubanio.com/packages/5b/12/b0409a94dad366d98a8eee2a77678c7a73aafd8c0e4b835abea634ea3896/cryptography-2.6.1-cp34-abi3-manylinux1_x86_64.whl (2.3MB)
Collecting funcsigs==1.0.2 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 76))
  Downloading http://pypi.doubanio.com/packages/69/cb/f5be453359271714c01b9bd06126eaf2e368f1fddfff30818754b5ac2328/funcsigs-1.0.2-py2.py3-none-any.whl
Collecting future==0.17.1 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 79))
  Downloading http://pypi.doubanio.com/packages/90/52/e20466b85000a181e1e144fd8305caf2cf475e2f9674e797b222f8105f5f/future-0.17.1.tar.gz (829kB)
Collecting idna==2.8 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 81))
  Downloading http://pypi.doubanio.com/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
Collecting ipaddress==1.0.22 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 84))
  Downloading http://pypi.doubanio.com/packages/fc/d0/7fc3a811e011d4b388be48a0e381db8d990042df54aa4ef4599a31d39853/ipaddress-1.0.22-py2.py3-none-any.whl
Collecting josepy==1.1.0 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 87))
  Downloading http://pypi.doubanio.com/packages/23/46/30ac29742b03be92e05d1fd9048df6f0902bb0b3b042a7ea76a2b3c30f7e/josepy-1.1.0-py2.py3-none-any.whl (53kB)
Collecting mock==1.3.0 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 90))
  Downloading http://pypi.doubanio.com/packages/b2/50/664a70b87408bb6c14c1af2337efa64eb8d1af80c933531758b8fb41ec25/mock-1.3.0-py2.py3-none-any.whl (56kB)
Collecting parsedatetime==2.4 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 93))
  Downloading http://pypi.doubanio.com/packages/e3/b3/02385db13f1f25f04ad7895f35e9fe3960a4b9d53112775a6f7d63f264b6/parsedatetime-2.4.tar.gz (58kB)
Collecting pbr==5.1.3 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 96))
  Downloading http://pypi.doubanio.com/packages/14/09/12fe9a14237a6b7e0ba3a8d6fcf254bf4b10ec56a0185f73d651145e9222/pbr-5.1.3-py2.py3-none-any.whl (107kB)
Collecting pyOpenSSL==19.0.0 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 99))
  Downloading http://pypi.doubanio.com/packages/01/c8/ceb170d81bd3941cbeb9940fc6cc2ef2ca4288d0ca8929ea4db5905d904d/pyOpenSSL-19.0.0-py2.py3-none-any.whl (53kB)
Collecting pyRFC3339==1.1 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 102))
  Downloading http://pypi.doubanio.com/packages/c1/7a/725f5c16756ec6211b1e7eeac09f469084595513917ea069bc023c40a5e2/pyRFC3339-1.1-py2.py3-none-any.whl
Collecting pycparser==2.19 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 105))
  Downloading http://pypi.doubanio.com/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB)
Collecting pyparsing==2.3.1 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 107))
  Downloading http://pypi.doubanio.com/packages/de/0a/001be530836743d8be6c2d85069f46fecf84ac6c18c7f5fb8125ee11d854/pyparsing-2.3.1-py2.py3-none-any.whl (61kB)
Collecting python-augeas==0.5.0 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 110))
  Downloading http://pypi.doubanio.com/packages/41/e6/4b6740cb3e31b82252099994cea751c648b846aa7874343c31d68c2215be/python-augeas-0.5.0.tar.gz (90kB)
Collecting pytz==2018.9 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 112))
  Downloading http://pypi.doubanio.com/packages/61/28/1d3920e4d1d50b19bc5d24398a7cd85cc7b9a75a490570d5a30c57622d34/pytz-2018.9-py2.py3-none-any.whl (510kB)
Collecting requests==2.21.0 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 115))
  Downloading http://pypi.doubanio.com/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl (57kB)
Collecting requests-toolbelt==0.9.1 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 118))
  Downloading http://pypi.doubanio.com/packages/60/ef/7681134338fc097acef8d9b2f8abe0458e4d87559c689a8c306d0957ece5/requests_toolbelt-0.9.1-py2.py3-none-any.whl (54kB)
Collecting six==1.12.0 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 121))
  Downloading http://pypi.doubanio.com/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting urllib3==1.24.2 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 124))
  Downloading http://pypi.doubanio.com/packages/df/1c/59cca3abf96f991f2ec3131a4ffe72ae3d9ea1f5894abe8a9c5e3c77cfee/urllib3-1.24.2-py2.py3-none-any.whl (131kB)
Collecting zope.component==4.5 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 127))
  Downloading http://pypi.doubanio.com/packages/97/e2/c785df1171f277ea93cc16bdcc112cb3ddfde1aeefbc401d46c49727f472/zope.component-4.5-py2.py3-none-any.whl (70kB)
Collecting zope.deferredimport==4.3 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 130))
  Downloading http://pypi.doubanio.com/packages/62/d2/e03e4b0c9103817e19d1ea577c1f7fb9b67e4c0397ca5127d377e1eafe0c/zope.deferredimport-4.3-py2.py3-none-any.whl
Collecting zope.deprecation==4.4.0 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 133))
  Downloading http://pypi.doubanio.com/packages/f9/26/b935bbf9d27e898b87d80e7873a0200cebf239253d0afe7a59f82fe90fff/zope.deprecation-4.4.0-py2.py3-none-any.whl
Collecting zope.event==4.4 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 136))
  Downloading http://pypi.doubanio.com/packages/c5/96/361edb421a077a4c208b4a5c212737d78ae03ce67fbbcd01621c49f332d1/zope.event-4.4-py2.py3-none-any.whl
Collecting zope.hookable==4.2.0 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 139))
  Downloading http://pypi.doubanio.com/packages/41/b5/378175b959565de41f45c775cdfbf8897aaeaf29a258b94e40bd2661ce46/zope.hookable-4.2.0.tar.gz
Collecting zope.interface==4.6.0 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 150))
  Downloading http://pypi.doubanio.com/packages/6e/83/c962fcbf0c1eaa6a4a9fe77f0ef7ff0ec00f2c09fee5ec8a69f6123b9755/zope.interface-4.6.0-cp34-cp34m-manylinux1_x86_64.whl (167kB)
Collecting zope.proxy==4.3.1 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 180))
  Downloading http://pypi.doubanio.com/packages/7c/f5/e9ed65cdf8c93d24d7512ef89e21b241bc9ae75d90bc8608cc142f4c26f9/zope.proxy-4.3.1.tar.gz (43kB)
Collecting letsencrypt==0.7.0 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 200))
  Downloading http://pypi.doubanio.com/packages/28/ca/cf17ceca2d8caf8f93ea844bd862ad3f595a796648958ae6c5faf846e354/letsencrypt-0.7.0.tar.gz
Collecting certbot==0.35.1 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 204))
  Could not find a version that satisfies the requirement certbot==0.35.1 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 204)) (from versions: 0.6.0, 0.7.0, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.10.0, 0.10.1, 0.10.2, 0.11.0, 0.11.1, 0.12.0, 0.13.0, 0.14.0, 0.14.1, 0.14.2, 0.15.0, 0.16.0, 0.17.0, 0.18.0, 0.18.1, 0.18.2, 0.19.0, 0.20.0, 0.21.0, 0.21.1, 0.22.0, 0.22.1, 0.22.2, 0.23.0, 0.24.0, 0.25.0, 0.25.1, 0.26.0, 0.26.1, 0.27.0, 0.27.1, 0.28.0, 0.29.0, 0.29.1, 0.30.0, 0.30.1, 0.30.2, 0.31.0, 0.32.0, 0.33.0, 0.33.1, 0.34.0, 0.34.1, 0.34.2)
No matching distribution found for certbot==0.35.1 (from -r /tmp/tmp.AsGG503CPy/letsencrypt-auto-requirements.txt (line 204))
=====================================================

Certbot has problem setting up the virtual environment.

We were not be able to guess the right solution from your pip 
output.

Consult https://certbot.eff.org/docs/install.html#problems-with-python-virtual-environment
for possible solutions.
You may also find some support resources at https://certbot.eff.org/support/ .

根据错误提示,应该是与版本有关。

下面有个人提供了解决方案,已测试有效

git clone https://github.com/letsencrypt/letsencrypt/
cd letsencrypt
git reset --hard ce4e00569e6d8ed3d51c5a078d4281bec5f8e5f0 # see release page for more info
./letsencrypt-auto  --no-self-upgrade renew --force-renew

具体来说就是重新下载了letsencrypt;然后git回退letsencrypt到指定版本;然后再执行renew,但是加上了

--no-self-upgrade
©️2020 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客 返回首页
实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值