我第一次尝试使用 Caddy。我希望能够为多个子域提供服务。Caddy 向 Let's Encrypt 请求 SSL 证书。我已经设法让它在 caddyfile 中只有一个域名的情况下正常工作。
但是,假设我有
www.example.com, test.example.com {
... lots of settings
}
Run Code Online (Sandbox Code Playgroud)
我依靠 Let's Connect 服务器回调这些子域之一(即不使用 DNS TXT 记录)。但这引发了一些问题:
(在上面的示例中只有两个子域,但实际上我想知道如何让它与两个以上的子域一起使用。)
-
编辑:当我尝试这个时test.example.com,我收到一个错误(注意:我隐藏了我的实际域名):
Activating privacy features...2016/11/21 07:47:41 [www.example.com] failed to get certificate: acme: Error 403 - urn:acme:error:unauthorized - Invalid response from http://www.example.com/.well-known/acme-challenge/ALmqQ8Vl5fvPF91tvqw2zigHlPoRRgTGR2GaLtgX3-A [134.92.240.68]: 404
Run Code Online (Sandbox Code Playgroud)
Caddy 打印更多细节,本质上是重复相同的信息,然后终止。
我正在使用 debain jessie,certbot 版本 0.9.3-1~bpo8+2。自过去两天以来,我在为我的网站续订证书时开始收到此错误。
Could not bind TCP port 443 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.
-------------------------------------------------------------------------------
Attempting to renew cert from /etc/letsencrypt/renewal/www.testsite.com.conf produced an unexpected error: object of type 'NoneType' has no len(). Skipping.
Run Code Online (Sandbox Code Playgroud)
我应该怎么办 ?我对 Letscrypt 不太熟悉。有人请遮光一下吗?
我在 Docker 容器中运行 Nginx,需要定期重新加载其配置以获取更新的Letsecnrypt SSL 证书。
在docker-compose文件中我有以下内容
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
Run Code Online (Sandbox Code Playgroud)
据我所知,应该每 6 小时重新加载配置并重新启动 Nginx。然而,它不起作用。SSL 证书已续订,但 Nginx 未获取它。
关于如何每隔几个小时正确地重新加载 Letsencrypt SSL 证书有什么想法吗?
更新 08/08/19
根据我的理解,这个问题与我挂载到容器中的证书文件实际上是符号链接有关,而符号链接不能很好地与 Docker 配合使用。
我正在尝试使用proxy_passnginx 来加密与上游服务器的连接。上游服务器的证书已由 LetsEncrypt certbot 创建。
# upstream server: nginx.conf
stream {
server {
listen 636 ssl;
ssl_certificate /etc/letsencrypt/live/upstream.example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/upstream.example.com/privkey.pem; # managed by Certbot
# ...
}
}
Run Code Online (Sandbox Code Playgroud)
当不在下游服务器中验证代理证书时,一切正常。
# downstream server: nginx.conf
stream {
server {
listen 636 ssl;
ssl_certificate /etc/letsencrypt/live/downstream.example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/downstream.example.com/privkey.pem; # managed by Certbot
proxy_ssl on;
proxy_ssl_verify off;
proxy_pass upstream.example.com:636;
# ...
}
}
Run Code Online (Sandbox Code Playgroud)
但是,如果我尝试验证下游服务器上的上游证书,则在 nginx 错误日志中与上游进行 SSL 握手时,会收到上游 SSL 证书验证错误:(2:无法获取颁发者证书) 。
# downstream server: …Run Code Online (Sandbox Code Playgroud) 根据官方 ACME.SH 文档链接,颁发证书就像运行以下命令一样简单:
$ acme.sh --issue --alpn -d example.com
Run Code Online (Sandbox Code Playgroud)
但是,我收到以下错误
Error, can not get domain token entry example.com for `tls-alpn-01`
The supported validation types are `http-01` `dns-01` , but you specified: `tls-alpn-01`
Run Code Online (Sandbox Code Playgroud)
我尝试从默认切换ZeroSSL.com到BuyPass.com,但这没有帮助。这些提供商似乎不允许tls-alpn-01验证方法,但这可能与我缺少的东西有关。
PS:抢先回答一些问题:
port 80被 ISP 阻止,因此tls-alpn-01netstat端口 443 是否未绑定到服务。--debug 2,我得到以下_authorizations_map变量值_authorizations_map='example.com,{"identifier":{"type":"dns","value":"example.com"},"status":"pending","expires":"2021-08-18T22 :53:50Z","挑战":[{"type":"http-01","url":"https://acme.zerossl.com/v2/DV90/chall/wYehJ8kQjUDiDadBJ12qKw","状态": "待处理","令牌":"Sfga2N2KwV-2hg3wo1gYAoyFvqV87dRvG2sHw4I6ups"},{"type":"dns-01","url":"https://acme.zerossl.com/v2/DV90/chall/CkrMQdEJthf-TmWvllW -Bg", "状态":"待处理","令牌":"_AlgMGzIfSQs7673Su-njnpieba_zLpSYxiUdXDEFnz"}]}'
我花了几个小时寻找解决方案,但找不到任何解决方案。我通过 certbot 使用 LetsEncrypt ssl。
我的域名是ektaz.com当我在浏览器上检查证书时它说
Expires: 8 November 2021 Monday 16:24:33 GMT+03:00
当我从服务器端检查它时,certbot certificates我得到的结果为
Expiry Date: 2021-11-08 13:24:33+00:00 (VALID: 39 days)
但所有浏览器都说证书无效我不明白为什么。
此外,我已经多次更新此证书,certbot renew到目前为止我没有任何问题。我已经清除了所有缓存,尝试结果是一样的。我多次重启apache。即使重新启动服务器但没有任何改变。
服务器操作系统:Ubuntu 20.04 LTS
我在生产服务器上使用Let的加密来处理SSL证书.我的网站证书将在下周到期,所以我使用letsencrypt-auto renew命令重新生成它(我还没有设置cron任务)
我得到的最后一个日志是2016-08-20 17:12:20,305:DEBUG:certbot.renewal:no renewal failures哪个平均证书已成功重新生成
但当我回到我的网站并检查证书属性时,它仍然表示它将在下周到期.
所以:
有人可以帮我澄清证书到期日的工作方式吗?
谢谢你的帮助 !
我在使用Docker和LetsEncrypt时遇到了麻烦.
据我所知,Certbot(在Apache或任何HTTP服务器上安装LetsEncrypt的机器人)检查用户是否拥有与证书关联的域.
所以在Dockerfile中,我添加以下行:
RUN certbot --apache -n --agree-tos --email me@mail.com -d domain.tld
Run Code Online (Sandbox Code Playgroud)
问题是在域检查期间,Certbot会在HTTP Server上安装证书,并检查此服务器是否通过解析域来公开已安装的证书.
我的意思是,只有在在线Web服务器上运行cerbot命令时,域检查才能生效.
但是在Docker镜像构建期间没有启动Apache服务器.
你有什么想法解决这个问题吗?我可以在容器启动后执行命令,但我想在Dockerfile中安装证书.
谢谢
假设文档,我应该使用策略,如下所示:
{
"Version": "2017-11-27",
"Statement":[
{
"Effect":"Allow",
"Action": [
"route53:ChangeResourceRecordSets"
],
"Resource": [
"arn:aws:route53:::hostedzone/<ZONE_ID>"
]
]
}
Run Code Online (Sandbox Code Playgroud)
我需要一个非常安全的政策.
我无法在arn中添加特定的资源记录集(区域中的一条记录).我可以Condition用来检查应该通过ChangeResourceRecordSetsAPI调用更改哪条记录.如果我没错的话.
这对于自动更新公共域区域中的一条记录是必需的.更新_acme-challenge.ldap.example.com.记录自动更新让我们加密证书.我知道acme.sh可以实现我的目标.但我想编写自己的自定义和简单脚本来执行此操作.
尝试使用golang在Google Cloud Platform上设置https时遇到问题,让我们加密
我已经有一个针对实例IP的域
我还让我们对保存在/etc/letsencrypt/live/mydomain.com/上的证书和链进行加密
我已经将myapp设置为使用证书,并配置为通过systemctl使用myapp.service作为服务运行
在完成所有这些配置之后,我总是得到下一条错误消息:
Feb 14 11:29:47 https https[1982]: 2019/02/14 11:29:47 listen tcp :443: bind: permission denied
Feb 14 11:29:47 https systemd[1]: https.service: Main process exited, code=exited, status=1/FAILURE
Feb 14 11:29:47 https systemd[1]: https.service: Unit entered failed state.
Feb 14 11:29:47 https systemd[1]: https.service: Failed with result 'exit-code'.
Run Code Online (Sandbox Code Playgroud)