【问题标题】:Certbot get ssl certificate HAproxyCertbot 获取 ssl 证书 HAproxy
【发布时间】:2022-01-21 05:27:25
【问题描述】:

我是网络新手,我需要向负载均衡器添加 SSL 证书。为此,我正在使用 Certbot。

说明:https://certbot.eff.org/instructions?ws=haproxy&os=ubuntufocal

基本上它说使用 SSH 登录到服务器,然后安装 certbot

然后,运行这个命令

sudo certbot certonly --standalone

它告诉我暂时停止我的网络服务器以获取证书,所以我运行了:

sudo service ssh stop

运行 certbot 命令后出现以下错误:

Could not bind TCP port 80 because it is already in use by another process on
this system (such as a web server). Please stop the program in question and then
try again.

所以我跑了:

sudo netstat -tulpn | grep :80

输出:

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      59283/nginx: master 
tcp6       0      0 :::80                   :::*                    LISTEN      59283/nginx: master 

现在,如果我使用“sudo service nginx stop”停止 nginx 服务并再次运行上述命令,我没有得到任何服务在端口 80 中侦听。所以我再次重试 Certbot 命令:

sudo certbot certonly --standalone

我收到以下错误:

Certbot failed to authenticate some domains (authenticator: standalone). The Certificate Authority reported these problems:
  Domain: totaldomainoftheworldclub.tech
  Type:   dns
  Detail: no valid A records found for totaldomainoftheworldclub.tech; no valid AAAA records found for totaldomainoftheworldclub.tech

Hint: The Certificate Authority failed to download the challenge files from the temporary standalone webserver started by Certbot on port 80. Ensure that the listed domains point to this machine and that it can accept inbound connections from the internet.

就是这样,我不知道还能做什么。

【问题讨论】:

  • “它告诉我暂时停止我的 Web 服务器以获取证书,所以我运行:sudo service ssh stop” - 当你被问到时,你正在停止 SSH 服务器停止网络服务器?
  • 是的,我试过了,以防万一。我实际上停止了nginx服务,这是停止Web服务器的方式吗?停止 nginx 后,我收到最后一条错误消息

标签: nginx ssl haproxy certbot


【解决方案1】:

如果你无法正常验证,可以尝试使用DNS challenge

请注意,对于 DNS 挑战,支持以下 DNS 提供商:cloudflare、cloudxns、digitalocean、dnsimple、dnsmadeeasy、gehirn、google、linode、luadns、nsone、ovh、rfc2136、route53、sakuracloud。

您可以在certbot docs 中查看如何使用 DNS 质询以及它需要哪些额外配置。但基本上,您需要在域 DNS 服务器中创建某种 API 密钥,然后将其提供给 certbot。然后在验证时,它会自动使用 API 添加新的 DNS 记录以进行验证。

您还可以在不同的机器甚至Google FunctionAWS lambda 中运行DNS 质询。以certbot-lambda 为例。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-01-19
    • 1970-01-01
    • 2022-11-22
    • 2016-06-29
    • 2013-02-09
    • 2013-10-14
    • 2020-07-06
    • 2021-04-10
    相关资源
    最近更新 更多