【发布时间】:2018-11-27 12:56:57
【问题描述】:
我有一个简单的应用程序,客户端通过 wss 连接在页面加载时发送加入 websocket 通道的请求。我已将我的应用程序部署到域 my_app.heroku.com 的 heroku。每当我打开我的网站时,我都会收到错误 Error in connection establishment: net::ERR_SSL_PROTOCOL_ERROR。我知道这是一个 SSL 问题,而且要使用 Heroku 的 SSL,您必须使用业余爱好者帐户。所以,我将应用程序升级为爱好者(一天前),但它并没有解决问题。
我已经用谷歌搜索了这个问题,从我看到的情况来看,除了升级到 Heroku Hobby 之外,似乎只有在使用自定义域名时才需要进行其他设置,而我不是。如何使用 Hobby dyno 让 SSL 在我的 my_app.heroku.com 域上工作?
编辑:如果我运行curl -vI <my_app>.heroku_app.com,我会得到以下信息:
curl -vI https://<my_app>.herokuapp.com
* Rebuilt URL to: https://<my_app>.herokuapp.com/
* Trying __.___.___.___...
* Connected to <my_app>.herokuapp.com (__.___.___.___) port 443
(#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 592 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
* server certificate verification OK
* server certificate status verification SKIPPED
* common name: *.herokuapp.com (matched)
* server certificate expiration date OK
* server certificate activation date OK
* certificate public key: RSA
* certificate version: #3
* subject: C=US,ST=California,L=San Francisco,O=Heroku\, Inc.,CN=*.herokuapp.com
* start date: Wed, 19 Apr 2017 00:00:00 GMT
* expire date: Mon, 22 Jun 2020 12:00:00 GMT
* issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert SHA2
High Assurance Server CA
* compression: NULL
* ALPN, server did not agree to a protocol
> HEAD / HTTP/1.1
> Host: <my_app>.herokuapp.com
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Server: Cowboy
Server: Cowboy
< Connection: keep-alive
Connection: keep-alive
< Content-Type: text/html; charset=utf-8
Content-Type: text/html; charset=utf-8
< Content-Length: 1154
Content-Length: 1154
< Date: Thu, 22 Nov 2018 08:39:51 GMT
Date: Thu, 22 Nov 2018 08:39:51 GMT
< Via: 1.1 vegur
Via: 1.1 vegur
【问题讨论】:
-
您是否尝试按照here 的说明手动上传证书?
-
@jusermar10 我没有,但我运行了
curl -vI <my_app>.heroku_app.com并且服务器证书验证正常,所以我认为手动上传不会解决问题,因为似乎已经有 SSL 证书?我已将 curl 跟踪添加到主帖子的编辑中
标签: ssl heroku websocket heroku-ssl