我想在 443 以外的不同端口上为网络服务器设置 certbot。运行时出现以下错误
certbot --apache -d <sub>.<domain>.<ext>
Run Code Online (Sandbox Code Playgroud)
授权程序失败。sub.domain.ext (tls-sni-01): urn:acme:error:connection :: 服务器无法连接到客户端以验证域 :: 无法连接到 external_ip:443 以进行 TLS-SNI-01 质询
在这个错误之后,我阅读了手册页,在那里我发现了这个:
--tls-sni-01-port TLS_SNI_01_PORT 执行 tls-sni-01 质询的端口号。测试模式下的 Boulder 默认为 5001。(默认值:443)
然后我尝试了以下方法来纠正这个错误:
certbot --apache --tls-sni-01-port 14831 -d <sub>.<domain>.<ext>
Run Code Online (Sandbox Code Playgroud)
添加 tls-sni-01-port 后,我得到了同样的错误。
是否可以使用不同的端口安装证书,或者我做错了什么?
我使用独立方法为多个域创建了多个 SSL 证书。我只对证书感兴趣,没有服务器集成。
他们现在正在更新。所以,我跑了:
certbot -d example.com --manual --preferred-challenges dns certonly
Run Code Online (Sandbox Code Playgroud)
并遵循每个域的说明(为每个域添加所需的 DNS 条目)。这样,我不必停止服务器并获得我的新证书。
我对这一切的(模糊)理解是,目前没有使用 DNS 质询自动更新证书的方法。或者您可能无法为“手动”方法自动更新证书?
无论如何,我写了这个脚本:
#!/bin/bash
for i in renewal/*;do
n=${i:8:-5};
echo $n;
# echo "\n" | certbot --text --agree-tos -d $n --manual --preferred-challenges dns --expand --renew-by-default --manual-public-ip-logging-ok certonly;
done
Run Code Online (Sandbox Code Playgroud)
此时,在renewal目录中所有域都有:
验证器 = 手册
和:
pref_challs = dns-01
Run Code Online (Sandbox Code Playgroud)
问题:
现在......当我运行“certbotrenew”时,它会在不使用我的脚本的情况下自动更新所有这些吗?
如何开始使用 DNS 质询实际创建新证书?
我拥有一个使用 Let's Encrypt 证书的网站。它不在 Cloudflare 后面,而是托管在 OVH,我接受来自它的直接流量。
现在,我设置了一个 apache2 Web 服务器并使用 certbot 自动生成证书。这里的问题是,当我在 Firefox 上查看证书信息时,我可以在页面底部看到它包含对“Cloudflare Nimbus2023”的引用,尽管我没有使用他们的服务。
下面所附的图片是它所显示的......
(由于某种原因,它不允许我附上图片)
谁能向我解释一下这是什么?Cloudflare 在这里访问什么?
我将 Ubuntu 16.04 与 Nginx 一起使用,并且我已经在我的操作系统(Ubuntu 16.04)上安装了 Nginx Certbot:
apt-get update -y
add-apt-repository ppa:certbot/certbot -y
apt-get update -y
apt-get upgrade python-certbot-nginx -y
Run Code Online (Sandbox Code Playgroud)
我设置了 Nginx 变量:
s_a="/etc/nginx/sites-available"
s_e="/etc/nginx/sites-available"
Run Code Online (Sandbox Code Playgroud)
我根据这些变量创建了一个应用程序配置:
sed "s/\${domain}/${1}/g" "~/${repo}/template_nginx_app" > "${s_a}/${domain}.conf"
ln -sf ${s_a}/${domain}.conf ${s_e}
Run Code Online (Sandbox Code Playgroud)
我基于 app conf 用 Certbot 创建了一个对应的 SSL 证书,这样:
certbot --nginx -d ${domain} -d www.${domain}
Run Code Online (Sandbox Code Playgroud)
在某些情况下,SSL 证书的创建方式不正确,只需在进行一些配置后重新开始即可。
我怎样才能完全删除 SSL 证书(除了删除${domain}.conf也由 Certbot 编辑/重新配置的应用程序配置)?
有没有直接从 Certbot 执行此操作的快速方法?我的愿望是应用程序配置文件和证书都不会留下任何残留物。
这可能是个好方法:
rm ${s_a}/${domain}.conf && rm ${s_e}/${domain}.conf
rm -rf /etc/letsencrypt/{live,renewal,archive}/{${DOMAIN},${DOMAIN}.conf}
Run Code Online (Sandbox Code Playgroud) 我需要帮助为 LetsEncrypt 设置 CertBot
我在 CentOS 7 上运行 Python 2.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. …Run Code Online (Sandbox Code Playgroud) 我有一台运行 2 个不同 Web 服务器(Apache 和 Nginx)的服务器。Apache 服务器负责处理定向到 Wordpress 站点的所有流量,而 Nginx 服务器则为我的 Python API 和 React Web App 提供服务。
由于与 Apache 的端口冲突,我必须将 API 设置为在端口 88 上运行,将 React 应用程序设置为在端口 90 上运行。我用这种方式进行了测试,结果成功了。所有请求都会转发到 443,所以我认为不安全端口是什么并不重要。
当我最终运行命令来添加证书时:
sudo certbot --nginx -d a.domain.com
Run Code Online (Sandbox Code Playgroud)
这给了我一个错误。经过进一步检查,我发现它试图在端口 80 而不是 88 上打开域。我做了一些研究并找到了规则--http-01-port并将其设置为 88,但它再次给了我同样的错误:
sudo certbot --nginx --http-01-port 88 -d a.domain.com
Run Code Online (Sandbox Code Playgroud)
经过多次尝试后,我担心 certbot 可能很快就会因为怀疑垃圾邮件而阻止我几个小时或几天,而我已经没有可能的解决方案了。
以前有人处理过这个吗?你是怎么解决这个问题的?
当我使用CertBot将Let's Encrypt证书添加到我的网站后,当我尝试访问我的网站域时,
我得到了。ERR_TOO_MANY_REDIRECTS
一些信息:
-mywebsite 使用 django、nginx 和 Gunicorn 构建。
server {
server_name www.example.com example.com;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/myproject;
}
location / {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.example.com) …Run Code Online (Sandbox Code Playgroud) 我从我目前工作的前任员工(他离开去另一份工作)那里继承了一个非常新的 magento 配置。最初的 Magento 是使用 v2.1.8 设置的,但由于项目的需求/要求发生了变化,我不得不多次更新/升级安装。因此,我不一定拥有安装时的所有原始文件(我备份了一些,但在多次更改后,我不得不削减我备份的内容)并且不一定可以询问最初的人安装/配置了他所做的。
最初的设置只是 apache2 上带有 https 的独立 magento-CE。部分问题是我现在使用 Magento 建议并设置 apache 在后台使用 varnish 缓存执行 http,而 nginx 处理实际的 https 内容。
第一个问题发生在 apache 服务器一夜之间神秘关闭时,没有任何粉丝关注。错误日志中仅收到一条 SIGTERM 消息,表明某些东西正在将其关闭。我追踪到一个 cron 作业,它运行了 letencrypt 的续订脚本,该脚本试图通过 apache2 验证证书(不再执行 https 或在端口 443 上进行通信)
我现在需要的是有关如何完成迁移设置的信息,以便更新脚本将与 nginx 而不是 apache2 一起使用。我能找到的所有关于设置 LetEncrypt 的说明似乎都假设您尚未执行任何操作并且还没有证书。但我确实有证书,只是没有 nginx 和 LetsEncrypt 正确运行更新所需的任何东西。
我修改了 /etc/letsencrypt/renewal/myhost.conf 以使用 nginx 而不是 apache 作为身份验证器。(我还修改了“安装程序”行,但不确定是否需要它,因为它是安装在 apache2 下的)
我在服务器根目录中重新创建了一个 .well-known/acme-challenge/test 文件,并添加了目录和位置问题,并确认可以从端口 8080 上的 http 上的 apache 服务器以及通过端口 443 上的 nginx 上的缓存访问它https。(返回“成功”作为内容)
但是当我运行 certbot 来测试续订时(根据我在各个说明页面中看到的建议),它失败了:
# certbot renew --pre-hook "service …Run Code Online (Sandbox Code Playgroud) 几个月前我设置了一个新服务器,运行 Ubuntu 18.04 LTS。我成功安装了 certbot 并使用 cloudflare DNS 插件创建了我的证书。
现在是更新的时候了,但是当我运行certbot renew(或其他各种 certbot 命令)时,我收到以下错误
# certbot renew
/usr/local/lib/python2.7/dist-packages/cryptography/__init__.py:39: 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 a future release.
CryptographyDeprecationWarning,
Traceback (most recent call last):
File "/usr/local/bin/certbot", line 7, in <module>
from certbot.main import main
File "/usr/local/lib/python2.7/dist-packages/certbot/main.py", line 2, in <module>
from certbot._internal import main as internal_main
File "/usr/local/lib/python2.7/dist-packages/certbot/_internal/main.py", line 21, in …Run Code Online (Sandbox Code Playgroud) 有人可以解释为什么 Certbot 使用以下重定向配置
server {
if ($host = example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name example.com;
listen 80;
return 404; # managed by Certbot
}
Run Code Online (Sandbox Code Playgroud)
而不是简单地这个?
server {
server_name example.com;
listen 80;
return 301 https://$host$request_uri;
}
Run Code Online (Sandbox Code Playgroud)
server_name基本上说这个配置只适用于 example.com,所以$host永远不会有什么不同,或者我错过了什么?
certbot ×10
lets-encrypt ×6
nginx ×4
apache2 ×2
ssl ×2
apache-2.4 ×1
bash ×1
centos7 ×1
cloudflare ×1
ovh ×1
port ×1
python ×1
redirect ×1
ubuntu ×1