我正在开发针对远程https Web服务的应用程序.在开发过程中,我需要将来自本地开发服务器(在ubuntu上运行nginx)的请求代理到远程https Web服务器.这是相关的nginx配置:
server {
server_name project.dev;
listen 443;
ssl on;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
location / {
proxy_pass https://remote.server.com;
proxy_set_header Host remote.server.com;
proxy_redirect off;
}
}
问题是远程HTTPS服务器只能通过SSLv3接受连接,如以下openssl调用所示.
不工作:
$openssl s_client -connect remote.server.com:443
CONNECTED(00000003)
139849073899168:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:177:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 226 bytes
---
New,(NONE),Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---
工作:
$openssl s_client -connect remote.server.com:443 -ssl3
CONNECTED(00000003)
使用当前设置,当我在浏览器中连接到它时,我的nginx代理会提供502 Bad Gateway.在错误日志中启用调试我可以看到消息:[info] 1451#0:* SSL握手时的对等关闭连接,而SSL握手到上游.
我尝试添加ssl_protocols SSLv3;到nginx配置,但没有帮助.
有谁知道如何设置它才能正常工作?
编辑 – 添加了额外的请求信息:
使用OpenSSL版本在Ubuntu 12.04上运行:
$openssl version
OpenSSL 1.0.1 14 Mar 2012
解决方案
由@Christopher Perrin提供的解决方案是将openssl降级到1.0.0.以下是为我成功完成此操作的命令(在AMD64上运行的ubuntu 12.04上):
wget http://launchpadlibrarian.net/81976289/openssl_1.0.0e-2ubuntu4_amd64.deb
sudo dpkg -i openssl_1.0.0e-2ubuntu4_amd64.deb
wget http://launchpadlibrarian.net/81976290/libssl1.0.0_1.0.0e-2ubuntu4_amd64.deb
sudo dpkg -i libssl1.0.0_1.0.0e-2ubuntu4_amd64.deb
最佳答案
您的问题的可能解决方案被描述为here
由于存在错误,您必须在Nginx系统中降级到OpenSSL 1.0.0.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。