【发布时间】:2017-12-15 16:50:17
【问题描述】:
我有一个在 Heroku 上运行的 Web 应用程序,域由 1und1(德国版的域名注册商 1and1)管理。为了通过“example.com”使该应用程序可用,我执行了以下操作:
- 在 1und1 中创建了 www.example.com 子域。
- 按照 Heroku 指南中的说明将其附加到 www.example.com.herokudns.com (CNAME www.example.com.herokudns.com)。
- 从 1und1 订购 SSL 证书并使用它们在 Heroku 端设置 HTTPS。
- 设置 HTTP 重定向 example.com ->
https://www.example.com使顶级域指向 Heroku。
这一切都很好,直到我尝试通过https://example.com 获取应用程序 - Chrome 向我显示“此站点无法提供安全连接”页面并显示 ERR_SSL_PROTOCOL_ERROR。
cURL 输出:
#1.
curl https://example.com
curl: (35) Server aborted the SSL handshake
#2.
curl -vs example.de
Rebuilt URL to: example.de/
Trying <example.de 1und1 IP address here>...
TCP_NODELAY set
Connected to example.de (<example.de 1und1 IP address here>) port 80 (#0)
GET / HTTP/1.1
Host: example.de
User-Agent: curl/7.51.0
Accept: */*
< HTTP/1.1 302 Found
< Content-Type: text/html; charset=iso-8859-1
< Content-Length: 203
< Connection: keep-alive
< Keep-Alive: timeout=15
< Date: Tue, 11 Jul 2017 14:19:30 GMT
< Server: Apache
< Location: http://www.example.de/
...
#3.
curl -vs https://example.de
Rebuilt URL to: https://example.de/
Trying <example.de 1und1 IP address here>...
TCP_NODELAY set
Connected to wavy.de (<example.de 1und1 IP address here>) port 443 (#0)
Unknown SSL protocol error in connection to example.de:-9838
Curl_http_done: called premature == 1
Closing connection 0
那么,问题是:如何使用 1und1 和 Heroku 设置 HTTPS 重定向?
【问题讨论】:
-
根据我的经验,通过1and1安装ssl证书后可能需要几个小时才能生效。
-
@user1628733,感谢您的回复!可能我应该在帖子中提到它,但我在 2-3 周前安装了 SSL 证书并且 HTTPS 确实有效。