【发布时间】:2017-01-17 17:37:14
【问题描述】:
我在 Bluemix 中添加了一个证书,在这篇文章之后:https://www.ibm.com/blogs/bluemix/2014/09/ssl-certificates-bluemix-custom-domains/
我可以在域选项卡中看到证书,这是我上传的。
现在我有一个运行 nginx 的容器,因为我们将它用作反向代理。以前它是处理 SSL 配置,但现在它直接在 Bluemix 中完成,我们只想接受 https 请求,而不配置证书。
我们所做的是将 http 请求转发到 https,就像帖子中建议的那样(虽然解释了如何为 node.js 做这件事)。我们得到这样的结果:
server {
listen 80;
server_name *hostname.domain*;
return 301 https://$http_host$request_uri;
}
在 443 部分,我们只听,没有 ssl 部分:
server {
listen 443;
server_name *host.domain*;
*other stuff for reverse proxy*
}
但是,当尝试访问它时,我在 chrome 中收到一个一般错误:ERR_SSL_PROTOCOL_ERROR
Firefox 提供了更多信息:
An error occurred during a connection to *host.domain*. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG
当我尝试从命令行检查证书时,我没有得到任何证书。
openssl s_client -connect *host.domain*:443
CONNECTED(00000003)
140250419918480:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:782:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 289 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1484673167
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
nginx 日志中没有错误,我无法判断问题是在 Bluemix 端,还是在 nginx 的配置中,或者 nginx 是否允许这种必须处理 https 请求的配置,而没有证书配置...
有人知道吗?
非常感谢。
问候。
【问题讨论】:
-
看起来像 stackoverflow.com/q/15394904/1072229 的副本。如果这不起作用,你真的需要在你的配置中包含“反向代理的其他东西”部分。