大网数据广告活动
服务器运维问答

Configure Nginx to support clients that require DH parameters of 1024 or smaller without weaking security for everyone else?

· 52CE 我爱测

A third party's web tool that accesses our web server appears to be using Java 6, which does not support DH parameters > 1024 bits. It can't connect to our server because we have a dhparams file set to 4096 bits. In Nginx, the dh…

问题原文

原帖链接 · Nick · CC BY-SA 3.0

A third party's web tool that accesses our web server appears to be using Java 6, which does not support DH parameters > 1024 bits. It can't connect to our server because we have a dhparams file set to 4096 bits.

In Nginx, the dhparams file is set in nginx.conf, using the ssl_dhparam parameter.

Presumably, if we regenerate the dhparams.pem file with 1024 bits, this will weaken security for everyone.

Is there any way to let this one legacy client connect with 1024 bit dhparams, while using 4096 for everyone else? To make matters more complicated, it appears that Java 6 doesn't have SNI support.

Is there a good way to handle this situation?

已采纳解答

原帖链接 · Steffen Ullrich · CC BY-SA 3.0

The client does not announce in the handshake which DH key strength it supports so the server cannot use a different DH key for different clients. But, the DH key is only used if DH ciphers are used. Modern clients prefer ECDHE instead and if your nginx accepts this preference then the handshake will not use the DH param at all since it will not do a DHE key exchange but an ECDHE key exchange. For configuration examples which prefer ECDHE see https://mozilla.github.io/server-side-tls/ssl-config-generator/.

As for clients without SNI: they will simply use the default host configured in nginx. Thus if you have a proper certificate there which matches all the names the non-SNI aware client might use to connect to your server then it should work.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-03-22)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。