问题描述:
我们使用certbot的https秘钥生成服务,创建了https网站。不过在使用”certbot renew”命令更新https秘钥时遇到如下问题,
Tue Dec 28 14:13:02 CST 2021=> certbot renew…
/usr/lib/python2.7/site-packages/OpenSSL/crypto.py:14: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
from cryptography import utils, x509
Failed to renew certificate xxx.com with error: HTTPSConnectionPool(host=’acme-v02.api.letsencrypt.org’, port=443): Max retries exceeded with url: /directory (Caused by SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘tls_process_server_certificate’, ‘certificate verify failed’)],)”,),))
All renewals failed. The following certificates could not be renewed:
/etc/letsencrypt/live/xxx.com/fullchain.pem (failure)
1 renew failure(s), 0 parse failure(s)
格式有点乱,问题的截图如下:
这个问题不太常见,在google/baidu一顿猛搜没有找到合适的答案。
后来经过不断反复尝试,发现一个简单命令可以解决问题。
解决方案:
使用命令”yum install ca-certificates”, 安装相关的组件,然后重新执行certbot renew即可。
注意:我的服务器是centos操作系统,用yum这个安装命令。其他的系统可用”apt install ca-certificates”等。
执行”yum install ca-certificates”命令后,安装的package如下
以上。