我使用certbot-auto来部署Let的加密SSL证书,并使用crontab -e更新证书,如下所示:
* 01 * * 1 /home/myname/certbot-auto --quiet
它有如下错误消息:
Bootstrapping dependencies for RedHat-based OSes...
yum is /usr/bin/yum
To use Certbot, packages from the EPEL repository need to be installed.
Please enable this repository and try running Certbot again.
我无法解决这个错误.请帮我!
我只是按照以下建议:https ://certbot.eff.org/#debianjessie-apache 在我的linux vps上安装let的加密证书.
但不幸的是,安装没有像我预期的那样,因为:
所以我最终决定删除certbot,而是尝试安装本地ssl证书,我亲自签名.我找不到certbot的直接卸载指南.你能帮忙吗?
谢谢
如何使用Certbot的Dnsimple插件通过DNS挑战自动获取和续订证书?我在网上找不到任何例子.
https://github.com/certbot/certbot/tree/master/certbot-dns-dnsimple
我在 let-encrypt certbot 上遇到一个奇怪的错误,这似乎与我的第二个域名中存在破折号有关(在真实的一个位置 8 对应于所述破折号的位置)。
无论我是尝试续订还是创建新证书,都会发生错误。原始(功能)证书是使用 certbot no pb ...
./certbot-auto certonly --nginx -d domain1 -d domain2
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Cert is due for renewal, auto-renewing...
Renewing an existing certificate
Performing the following challenges:
tls-sni-01 challenge for domain1
tls-sni-01 challenge for domain-2
Cleaning up challenges
An unexpected error occurred:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 8: ordinal not in range(128)
Run Code Online (Sandbox Code Playgroud)
我可以从这里做什么?
Certbot和nginx版本:
使用certbot.eff.org安装指南安装certbot.
获得ssl证书工作正常:
certbot --nginx
但是,在更新cerbot认证
certbot renew --dry-run
nginx无法启动导致:
nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)
我试过更改后挂钩和预挂钩 /etc/letsencrypt/renewal/*com.conf/
installer=nginx添加post和pre hooks /etc/letsencrypt/renewal-hooks/pre/以及/etc/lestencrypt/renewal-hooks/post/停止和启动nginx服务.
似乎nginx无法正常启动或未正常停止.续订完成后nginx失败(代码=退出,状态= 1/FAILURE)
Nginx错误日志显示:
昨天一切都很好,但是今天,使用certbot-auto运行相同的命令来更新证书,我得到了:
Upgrading certbot-auto 0.31.0 to 0.32.0...
Replacing certbot-auto...
Creating virtual environment...
Installing Python packages...
/opt/eff.org/certbot/venv/bin/python: No module named pip.__main__; 'pip' is a package and cannot be directly executed
Traceback (most recent call last):
File "/tmp/tmp.eUWQ3w7cFV/pipstrap.py", line 177, in <module>
sys.exit(main())
File "/tmp/tmp.eUWQ3w7cFV/pipstrap.py", line 149, in main
pip_version = StrictVersion(check_output([python, '-m', 'pip', '--version'])
File "/usr/lib/python2.7/subprocess.py", line 544, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/opt/eff.org/certbot/venv/bin/python', '-m', 'pip', '--version']' returned non-zero exit status 1
Run Code Online (Sandbox Code Playgroud)
我使用的是Debian 7.9版...有人遇到同样的问题?
我正在尝试部署Node.js/Express应用程序Docker,使用让我们为 HTTPS 加密 SSL 证书。
当我运行docker-compose up命令时,所有 3 个服务都已启动,但我注意到这样的警告:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
No certs found.
Run Code Online (Sandbox Code Playgroud)
当 docker 尝试RUN /scripts/certbot-auto -n certificates在certbot/Dockerfile文件中执行命令时会发生此警告。
里面的/var/log/letsencrypt/letsencrypt.log文件我看到这个:
2019-08-21 10:27:50,354:DEBUG:certbot.main:certbot version: 0.37.1
2019-08-21 10:27:50,355:DEBUG:certbot.main:Arguments: ['-n']
2019-08-21 10:27:50,355:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#apache,PluginEntryPoint#manual,PluginEntryPoint#nginx,Plugin$
2019-08-21 10:27:50,372:DEBUG:certbot.log:Root logging level set at 20
2019-08-21 10:27:50,372:INFO:certbot.log:Saving debug log to /var/log/letsencrypt/letsencrypt.log
Run Code Online (Sandbox Code Playgroud)
同样在 nginx 容器的日志中,我注意到这样的警告:
2019/08/21 10:28:37 [emerg] 1#1: cannot load certificate "/etc/letsencrypt/live/tols/fullchain.pem": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/tols/fullchain.pem','r') …Run Code Online (Sandbox Code Playgroud) 我尝试输入命令来获取证书,但它给了我这个错误:发生意外错误:服务器不会为标识符颁发证书 :: 创建新订单时出错 :: 无法颁发“ec2-34-237-242” -160.compute-1.amazonaws.com”:ACME服务器拒绝为此域名颁发证书,因为它被策略禁止
我已经安装了 certbot,并且 certbot 制作了自己的 systemd 服务文件“certbot.service”用于自动证书更新,该文件每天通过 .timer 文件启动一次。
成功执行此“certbot.service”后,我喜欢执行第二个(“cert-copy-after-certbot.service”),将证书复制到另一个位置。
目前我的设置如下所示:
“certbot.service”(由 certbot 生成):
pi@raspberrypi:/lib/systemd/system $ cat certbot.service
[Unit]
Description=Certbot
Documentation=file:///usr/share/doc/python-certbot-doc/html/index.html
Documentation=https://letsencrypt.readthedocs.io/en/latest/
[Service]
Type=oneshot
ExecStart=/usr/bin/certbot -q renew
PrivateTmp=true
Run Code Online (Sandbox Code Playgroud)
“cert-copy-after-certbot.service”:
pi@raspberrypi:/etc/systemd/system $ cat cert-copy-after-certbot.service
[Unit]
Description=crt update after certbot has run
Wants=certbot.service
After=certbot.service
[Service]
Type=simple
ExecStart=/bin/sh -c "cat /etc/letsencrypt/live/<mydomain>/privkey.pem /etc/letsencrypt/live/<mydomain>/fullchain.pem > /etc/ejabberd/ejabberd.pem"
Run Code Online (Sandbox Code Playgroud)
如果我运行这个文件:
systemctl start <unitname>
Run Code Online (Sandbox Code Playgroud)
两项服务均正常运行。
但是当我用“systemctl start certbot”启动 certbot 并检查
systemctl status cert-copy-after-certbot
Run Code Online (Sandbox Code Playgroud)
cert-copy-after-certbot.service 未运行。
是我配置错误了吗?
我在使用 certbot-auto 更新我的证书时遇到了权限问题,因为每当它运行时都会显示以下消息:
Requesting to rerun certbot-auto with root privileges...
Run Code Online (Sandbox Code Playgroud)
它不需要以 root 身份运行,因为运行该命令的用户拥有 certbot 使用的所有目录的权限。我找不到任何命令行选项来禁用此功能,但查看脚本本身,我发现当它重新运行时,它会检查参数
--cb-auto-has-root,如果存在,它不会尝试(再次)获取根权限。我发现如果我用这个命令运行 certbot-auto ,它就像非 root 一样运行得很好!
但我不确定是否应该使用这个解决方法 - 因为它没有记录 - 或者将来会中断。作为非 root 用户运行的推荐方法是什么?