简体   繁体   English

NGINX 缓存代理失败,并显示 SSL23_GET_SERVER_HELLO:sslv3 警报握手失败

[英]NGINX caching proxy fails with SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

NGINX acting as a caching proxy encounters problems when fetching content from CloudFront server over HTTPS:充当缓存代理的 NGINX 在通过 HTTPS 从 CloudFront 服务器获取内容时遇到问题:

This is the extract from the NGINX's error log:这是 NGINX 错误日志的摘录:

2014/08/14 16:08:26 [error] 27534#0: *11560993 SSL_do_handshake() failed (SSL: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure) while SSL handshaking to upstream, client: 82.33.49.135, server: localhost, request: "GET /static/images/media-logos/best.png HTTP/1.1", upstream: " https://xxxx:443/static/images/media-logos/best.png ", 2014/08/14 16:08:26 [错误] 27534#0:*11560993 SSL_do_handshake() 失败(SSL:错误:14077410:SSL 例程:SSL23_GET_SERVER_HELLO:sslv3 警报握手失败),同时客户端握手:SSL3.82 49.135,服务器:本地主机,请求:“GET /static/images/media-logos/best.png HTTP/1.1”,上游:“ https://xxxx:443/static/images/media-logos/best.png ” ,

I tried different proxy setting like proxy_ssl_protocols and proxy_ssl_ciphers but no combination worked.我尝试了不同的代理设置,如 proxy_ssl_protocols 和 proxy_ssl_ciphers,但没有组合工作。

Any ideas?有任何想法吗?

I had the exactly same problem and spent a couple of hours... I guess you are using older version of nginx (lower than 1.7)?我遇到了完全相同的问题并花了几个小时...我猜您使用的是旧版本的 nginx(低于 1.7)? In nginx 1.7 you can use this directive :在 nginx 1.7 中,您可以使用此指令

proxy_ssl_server_name on;

This will force nginx to use SNI Also, you should set the SSL protocols:这将强制 nginx 使用SNI此外,您应该设置 SSL 协议:

proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

For earlier versions you may be able to use this patch (but I can't verify that that is working):对于早期版本,您可以使用此补丁(但我无法验证它是否有效):

http://trac.nginx.org/nginx/ticket/229 http://trac.nginx.org/nginx/ticket/229

2019 Update : You should avoid TLSv1 and TLSv1.1 and disable them if possible. 2019 更新:您应该避免使用 TLSv1 和 TLSv1.1,并尽可能禁用它们。 I'll leave them in the answer as they are still valid for SNI.我会将它们留在答案中,因为它们对 SNI 仍然有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM