# Let's Encrypt 的 DNS 验证？

**URL:** https://meta.discourse.org/t/dns-validation-for-lets-encrypt/139848
**Category:** Self-hosting
**Created:** [2020年一月27日 16:00 UTC](https://meta.discourse.org/t/dns-validation-for-lets-encrypt/139848 "2020-01-27T16:00:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![danb35](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@danb35](https://meta.discourse.org/u/danb35)
#### Post date: [2020年一月27日 16:00 UTC](https://meta.discourse.org/t/dns-validation-for-lets-encrypt/139848/1 "2020-01-27T16:00:00Z")

</div>

我想在无法从互联网访问的私有网络上安装 Discourse，但仍希望使用 Let’s Encrypt 配置 SSL。我已经为同一网络上的其他主机多次使用 DNS 验证，无论是通过 acme-dns（首选）还是 Cloudflare 的 DNS API，效果都很好。我能想到两种可能的解决方案：

- （首选）标准的 Docker 容器安装能否配置为使用 Let’s Encrypt 的 DNS 验证？

- 如果不能，是否有办法将 Discourse 容器指向文件系统中的某个证书/密钥，并在生成新证书时使其自动重新加载？

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2020年一月27日 16:39 UTC](https://meta.discourse.org/t/dns-validation-for-lets-encrypt/139848/2 "2020-01-27T16:39:27Z")

</div>

> [@danb35](#):
>
> 标准 Docker 容器安装能否配置为使用 Let’s Encrypt 的 DNS 验证？

一切皆有可能。你应该可以在容器内部进行更改，让 `acme` 实现该功能。我目前不知道有任何说明文档描述此过程。你可以运行 `./launcher enter app` 进入容器并做出更改，这些更改在重建容器之前会一直生效。你也可以在 `app.yml` 中添加内容，以便在重建时应用这些更改，但那样你就已经远离官方支持的安装方式了。

> [@danb35](#):
>
> 有没有办法让 Discourse 容器指向文件系统中的某个证书/密钥，并在生成新证书时使其重新加载？

> [@Allow SSL / HTTPS for your Discourse Docker setup](https://meta.discourse.org/t/advanced-setup-only-allowing-ssl-https-for-your-discourse-docker-setup/13847):
>
> This guide is likely out of date as there are now very few reasons not to use the built-in Let’s Encrypt certificate that Just Works. See also: 2023-04-10 @pfaffman says: This is left here mostly for historical purposes. So you’d like to enable SSL for your Docker-based Discourse setup? Let’s do it! This guide assumes you used all the [standard install](https://meta.discourse.org/t/142537?silent=true) defaults – a container configuration file at/var/discourse/containers/app.yml and Discourse docker is installed at: /var/discourse Buy a SS…

---

<div class="post-metadata">

### Author: ![danb35](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@danb35](https://meta.discourse.org/u/danb35)
#### Post date: [2020年一月27日 18:59 UTC](https://meta.discourse.org/t/dns-validation-for-lets-encrypt/139848/3 "2020-01-27T18:59:27Z")

</div>

谢谢，你提供的链接看起来应该能解决问题。我还有一个后续问题，但可能在那个话题下讨论更合适。

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2020年二月26日 19:05 UTC](https://meta.discourse.org/t/dns-validation-for-lets-encrypt/139848/4 "2020-02-26T19:05:44Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
