使用certbot更新ssl cert for gitlab&让encryption

我正在ubuntu 14上运行gitlab。以前configuration的证书已过期(没有cron条目被设置为更新)。 我正在尝试安装certbot(让我们encryption)更新证书,然后设置自动续订的crontab项。 当我运行certbot时,我得到了一个复制到下面的消息(有一个位置,我可以抓住一个更详细的错误信息):

正在运行的命令:

./certbot-auto certonly --webroot -w /opt/gitlab/ssl -d git.xyz.com 

git.xyz.com是一个有效的域名(我用xyzreplace了实际的域名)。 目录/ opt / gitlab / ssl存在,用于运行该命令的用户对该目录及其内容具有读/写权限。

错误授权程序失败。 git.xyz.com(http-01):urn:acme:error:connection ::服务器无法连接到客户端来validation域名:无法连接到git.xyz.com

重要笔记:

 - The following errors were reported by the server: Domain: git.xyz.com Type: connection Detail: Could not connect to git.xyz.com To fix these errors, please make sure that your domain name was entered correctly and the DNS A record(s) for that domain contain(s) the right IP address. Additionally, please check that your computer has a publicly routable IP address and that no firewalls are preventing the server from communicating with the client. If you're using the webroot plugin, you should also verify that you are serving files from the webroot path you provided. 

任何想法如何我可以更好地debugging这个问题?

忘了提及:我可以从外部networking访问URL(域名是正确的),目前没有configuration防火墙来阻止端口80/443上的stream量(我甚至closures了防火墙进行testing)。

我不确定这是否有帮助,但至less我可以想象这是问题所在:

  • 如果通过http连接,您将自动redirect到https
  • 这个redirect也适用于让我们encryption,所以他们会得到你的无效,由于date,证书。
  • 此时连接将不会成功,导致显示给您的错误。
  • 另外,你正在使用HSTS 。 我不确定Let's Encrypt是否尊重这个标题,如果他们曾经看过的话。

那么该怎么办? 我不太清楚,但这里有一些提示:

  • 禁用httpredirect到https ,然后重试。
  • 如果HSTS受到尊重:

    • HSTS标头设置为非常短的一秒钟,如一秒钟,将此configuration放在适当位置,再次运行Let's Encrypt客户端,以便获取新标头,禁用redirect,等待一段时间,然后再次运行客户端。

    • 如果这不起作用:获取另一个有效的证书,例如由StartSSL颁发的证书,安装它并重试。

为将来:

  • 设置自动证书更新,另外还要进行监控,在这种情况发生之前,至less会发生类似这样的事情。

做一些好事:

  • 创build一张票或写一个post到他们的论坛/电子邮件中,解释发生了什么事情,并询问他们是否可以检查这些错误,并给人一个提示(又名更好的错误信息)。

(轻微:如果你不想公开你的域名,你应该从你的post中删除它。)