Let's Encrypt 证书更新,但网站提供旧的

Ion*_*zău 1 lets-encrypt

我的 https 证书将在大约一周后到期,我运行脚本来更新它们。

它们似乎已更新,因为如果我尝试certbot-auto再次运行它,它会向我显示一些消息,说证书到期日期应该更接近今天的日期。

问题是该网站看起来仍在提供旧证书。保质期不变。

这是预期的吗?如何强制更新证书?

相关输出:

$ echo | openssl s_client -connect ionicabizau.net:443 2>/dev/null | openssl x509 -noout -dates
notBefore=Aug 28 03:40:00 2016 GMT
notAfter=Nov 26 03:40:00 2016 GMT
Run Code Online (Sandbox Code Playgroud)

服务器上的文件看起来更新了:

$ ls
cert.pem  chain.pem  fullchain.pem  privkey.pem
$ stat -c '%y' *
2016-11-17 06:03:20.838837999 +0000
2016-11-17 06:03:20.838837999 +0000
2016-11-17 06:03:20.838837999 +0000
2016-11-17 06:03:20.838837999 +0000
Run Code Online (Sandbox Code Playgroud)

Ger*_*der 6

Web 服务器守护进程(apache、nginx 等)仅在加载配置时加载证书,并在运行时将它们保存在内存中。certbot 提供了一些钩子参数,您可以使用这些参数在更新证书后重新加载守护程序。

文档中的示例:

certbot renew --pre-hook "service nginx stop" --post-hook "service nginx start"
Run Code Online (Sandbox Code Playgroud)

不过,使用 post hook 重新加载服务应该就足够了。这是我使用的:

certbot renew --deploy-hook "service nginx reload"
Run Code Online (Sandbox Code Playgroud)

当然,您可以service nginx reload在每次运行 certbot 后运行,但使用更新钩子的好处是只有在实际更新证书时才会重新加载守护程序。