8

我已按照 Heroku 的自动证书管理说明通过LetsEncrypt为我的 Ruby Sinatra 应用程序生成 SSL 证书(向 LetsEncrypt 和 heroku 致敬!!),但为我的自定义域生成 SSL 证书失败。

激活自动证书管理后,我的应用程序的 heroku 域名从 *.herokuapp.com 更改为 *.herokudns.com,正如预期的那样。

我已经相应地更新了我的 Google 域记录,但是 Google 域不允许将域根指定为 CNAME 记录。相反,根需要通过子域转发指向 http(s)://www.mycustomdomain.com,即

mycustomdomain.com --> http://www.mycustomedomain.com

当 heroku 的证书生成过程运行时,它希望www.mycustomdomain.commycustomdomain.com都得到验证。域根通过子域转发指向 www 地址的事实似乎阻止了域根的验证。

我猜这会导致自定义域 SSL 证书的生成失败?

在我与 heroku 核对之前,我正在联系 stackoverflow 社区,以防有人遇到并解决了这个问题?

heroku 上的自定义域设置

user@machine1:~/projects/mycustomdomain$ heroku domains
=== mycustomdomain Heroku Domain
mycustomdomain.herokuapp.com

=== mycustomdomain Custom Domains
Domain Name       DNS Target
────────────────  ──────────────────────────────
mycustomdomain.com      mycustomdomain.com.herokudns.com
www.mycustomdomain.com  www.mycustomdomain.com.herokudns.com 

谷歌域配置

子域转发

mycustomdomain.com --> http://www.mycustomdomain.com

*.mycustomdomain.com --> http://www.mycustomdomain.com

自定义资源记录

<table style="border:1px solid black; border-collpase">
  <tr>
    <th>NAME</th>
    <th>TYPE</th>
    <th>TTL</th>
    <th>DATA</th>
  </tr>
  <tr>
    <td>www</td>
    <td>CNAME</td>
    <td>1h</td>
    <td>www.mycustomdomain.com.herokudns.com</td>
  </tr>
</table>


作为一个迟来的更新,我已经找到了以下链接,我已经成功地使用它来配置我在 Google Domains 上托管的应用程序,以使用 Let's Encrypt SSL:https ://medium.com/@connorleech/https-ssl-on- heroku-with-google-domains-as-dns-provider-c55c438556c6

(我提供链接而不是在这里重述信息,因为它是相当多的信息)

4

1 回答 1

4

Heroku 已确认:

要使用顶级域,我们建议切换到支持顶级域的类似 CNAME 功能的 DNS 提供商,例如 Cloudflare,然后重新启用 ACM。

这记录在他们的网站上: https ://devcenter.heroku.com/articles/custom-domains#configuring-dns-for-root-domains

于 2017-04-04T21:38:19.403 回答