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

how to validate dhparams in apache <=2.4.6

· 52CE 我爱测

How can I validate that I've properly setup my Apache 2.4.6 server with a custom 2048-bit (or 4096-bit) dhparams config? Following the weakdh.org sysadmin guide , I created my own dhparams.pem file with openssl dhparam -out dhpar…

问题原文

原帖链接 · Michael Altfield · CC BY-SA 3.0

How can I validate that I've properly setup my Apache 2.4.6 server with a custom 2048-bit (or 4096-bit) dhparams config?

Following the weakdh.org sysadmin guide, I created my own dhparams.pem file with openssl dhparam -out dhparams.pem 2048. The guide says to add this to the apache mod_ssl config with SSLOpenSSLConfCmd DHParameters "{path to dhparams.pem}", but this is only valid for Apache >= v2.4.7. I'm using CentOS 7, which uses Apache v2.4.6.

According to this server fault question, the solution in Apache v2.4.6 is to append it to the certificate file. So I did a cat /etc/pki/dhparam/dhparam.pem >> /etc/letsencrypt/live/openbuildinginstitute.org/cert.pem (and also cat /etc/pki/dhparam/dhparam.pem >> /etc/letsencrypt/live/openbuildinginstitute.org/fullchain.pem` && restarted apache.

But how do I verify from the client-side (my browser) that this config is in effect?

This is especially an issue as we use Let's Encrypt, so we want to make sure our 90-day cert renewals include this step, and I want to be able to verify it from the browser.

I already tried downloading the certificate with firefox's "View Certificate" -> "Details" -> "Export...", and I confirmed that the "-----BEGIN DH PARAMETERS-----" was absent from the resulting file.

已采纳解答

原帖链接 · FalcoGer · CC BY-SA 4.0

You can check the exact prime in use by using wireshark and listening on the connection.

  1. Filter the connection with ssl && ip.addr = <host ip>
  2. connect to the server with openssl s_client -connect <ip or fqdn>:443 -servername <virtual host name> -tls1_2 -cipher DHE. DHE is important because ECDHE uses a different scheme.
  3. Check wireshark for the ServerKeyExchange. You get the key length in bytes and the prime. I didn't put a dhparams in, so you can see that apache2 uses the Oakley Group 2 prime (RFC 2409).
  4. Compare with the prime in your DH file with openssl dhparam -in /path/to/dhparam.pem -noout -text -check.

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

资料来源与适用范围

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

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

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