简体   繁体   English

未能续订让我们加密SSL

[英]Failing to renew Let's Encrypt SSL

I easily installed an SSL certificate the first time through, but I am unable to get it to renew. 我第一次轻松安装了SSL证书,但我无法续订。

I scheduled the terminal command to automatically renew the certificate each month, but it is responding with an error. 我安排了terminal命令每个月自动续订证书,但它正在响应错误。 I also get the same response when running it manually. 手动运行时,我也得到相同的响应。

Terminal Command 终端命令

curl -X POST https://forge.laravel.com/api/servers/<serverNumber>/sites/<siteNumber>/ssl/renew?api_token=<my-token>

Response 响应

Cloning into 'letsencrypt1462928414'...
nginx stop/waiting
nginx start/running, process 10734
# INFO: Using main config file /root/letsencrypt1462928414/config.sh
+ Generating account key...
+ Registering account key with letsencrypt...
Processing donniebrandt.com with alternative names: www.donniebrandt.com
 + Signing domains...
 + Creating new directory /root/letsencrypt1462928414/certs/donniebrandt.com ...
 + Generating private key...
 + Generating signing request...
 + Requesting challenge for donniebrandt.com...
 + Requesting challenge for www.donniebrandt.com...
 + Responding to challenge for donniebrandt.com...
ERROR: Challenge is invalid! (returned: invalid) (result: {"type":"http-01","status":"invalid","error":{"type":"urn:acme:error:unauthorized","detail":"Invalid response from http://donniebrandt.com/.well-known/acme-challenge/JdG5PtzEcqZMMDVhx2VNN5Wmvldwtl84B6q3j1AQcP0 [104.18.50.184]: 526"},"uri":"https://acme-v01.api.letsencrypt.org/acme/challenge/S6oIx5ZFyzu80fkpjoCcAgVDp7p8aLo6UGLLt7flP-g/81801388","token":"JdG5PtzEcqZMMDVhx2VNN5Wmvldwtl84B6q3j1AQcP0","keyAuthorization":"JdG5PtzEcqZMMDVhx2VNN5Wmvldwtl84B6q3j1AQcP0.0N_sDHF2rXqfyPHGi4ZmXDAkrmwbMJ-S_ZghYPtSN2g","validationRecord":[{"url":"http://donniebrandt.com/.well-known/acme-challenge/JdG5PtzEcqZMMDVhx2VNN5Wmvldwtl84B6q3j1AQcP0","hostname":"donniebrandt.com","port":"80","addressesResolved":["104.18.50.184","104.18.51.184"],"addressUsed":"104.18.50.184"},{"url":"https://donniebrandt.com/.well-known/acme-challenge/JdG5PtzEcqZMMDVhx2VNN5Wmvldwtl84B6q3j1AQcP0","hostname":"donniebrandt.com","port":"443","addressesResolved":["104.18.50.184","104.18.51.184"],"addressUsed":"104.18.50.184"}]})

I also verified that the .well-known/acme-challenge directory exists, but it doesn't change the error. 我还验证了.well-known/acme-challenge目录是否存在,但它不会更改错误。

The error message shows your website is offline for one of the domains: 错误消息显示您的网站对其中一个域处于脱机状态:

ERROR: [...]"Invalid response from http://donniebrandt.com/[...]526"},[...]

Try access http://donniebrandt.com and you will get error 526 (invalid SSL certificate). 尝试访问http://donniebrandt.com ,您将收到错误526(无效的SSL证书)。

As cloudfare states : 云计划表明

The HTTP Error Response Code 526 occurs when CloudFlare is unable to successfully validate the SSL certificate on the origin web server and the CloudFlare SSL configuration on the website is set to "Full SSL (Strict)". 当CloudFlare无法在原始Web服务器上成功验证SSL证书并且网站上的CloudFlare SSL配置设置为“完整SSL(严格)”时,会出现HTTP错误响应代码526。

In other words, the CDN you´ve setup in front of your server tries to reach your server through HTTPS, however your SSL certificate is invalid (maybe expiered or root CA not trusted by Cloudfare CDN). 换句话说,您在服务器前设置的CDN会尝试通过HTTPS访问您的服务器,但您的SSL证书无效(可能已过期或根据Cloudfare CDN不信任的根CA)。 So Cloudfare will not fetch content from your server. 因此,Cloudfare不会从您的服务器获取内容。

I am not familiar with Cloudfare but you can do one of the following: 我不熟悉Cloudfare,但您可以执行以下操作之一:

  • disable temporally strict SSL in cloudfare until you renew your certificate and, next time, renew before it expires so there is no need to disable it again. 在云计算中禁用临时严格的SSL,直到您续订证书,并在下次更新之前续订,因此无需再次禁用它。
  • temporally redirect your DNS direct to you server instead of CDN, renew certificate and redirect it again. 暂时将您的DNS直接重定向到您的服务器而不是CDN,续订证书并再次重定向。 The downside here is that DNS propagation might take sometime and you will loose benefit of CDN for a long period depending on DNS setup. 这里的缺点是DNS传播可能需要一段时间,并且您将长期失去CDN的好处,具体取决于DNS设置。

Since you said you got SSL working first time I am assuming Cloudfare trusts LetsEncrypt (or it would not work for the first time). 既然你说你第一次使用SSL工作我假设Cloudfare信任LetsEncrypt(或者它第一次不能工作)。 However worth check it. 不过值得一试。

It's not really a fix, but I skirted the issue by recreating the site in Forge and reinstalling an SSL. 这不是一个真正的解决方案,但我通过在Forge中重新创建站点并重新安装SSL来绕过这个问题。

This should no longer be an issue since Forge now handles SSLs better. 这应该不再是一个问题,因为Forge现在可以更好地处理SSL。

Forge will now automatically renew LetsEncrypt certificates for you every week. Forge现在将每周为您自动续订LetsEncrypt证书。 You no longer need to manually add a scheduled job to perform the renewal. 您不再需要手动添加计划作业来执行续订。 To generate an auto-renewing LetsEncrypt certificate, simply obtain and activate a new certificate using the form above. 要生成自动续订LetsEncrypt证书,只需使用上面的表单获取并激活新证书。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM