How to fix ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY
ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY means the server offered a Diffie-Hellman key-exchange group too small to be safe, so the browser refused it. Browsers reject Diffie-Hellman groups under 1024 bits, and current Chrome and Firefox removed the classic DHE cipher suites entirely, so the durable fix is to move to elliptic-curve ECDHE key exchange rather than to enlarge the group.
- Likely cause
- Server offers a Diffie-Hellman group below the safe size
- Severity
- High — browsers refuse the weak exchange
- Time to fix
- About 15 minutes
- Prevention
- Prefer ECDHE, or generate a 2048-bit DH group
What causes it
- The server config uses a built-in 512-bit or 1024-bit Diffie-Hellman group.
- An old dhparam file with a small group is still referenced.
- The cipher list prefers classic DHE over the elliptic-curve ECDHE exchange.
How to fix it
1. Prefer elliptic-curve key exchange
The simplest fix is to prefer ECDHE cipher suites, which avoid the classic DH group entirely. Set a modern cipher list and reload.
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL;2. If you keep classic DHE, generate a strong group
If DHE must stay, replace the small group with a freshly generated 2048-bit one and point the server at it.
openssl dhparam -out dhparam.pem 20483. Reference the group, test, and reload
Point the server at the new dhparam file, test the config, and reload.
ssl_dhparam /etc/nginx/dhparam.pem; sudo nginx -t && sudo systemctl reload nginx
How to prevent it
Standardise on ECDHE key exchange, keep any DH group at 2048 bits or above, and grade the negotiated key exchange from outside so a weak group is flagged before a browser refuses it.
Source: Mozilla server-side TLS guidance
Common questions
What size Diffie-Hellman group is safe?
At least 2048 bits. Browsers reject groups under 1024 bits, and 1024 is considered weak, so use a 2048-bit group or, better, elliptic-curve ECDHE key exchange.
Is generating dhparam slow?
Generating a 2048-bit group takes a short while and only happens once. You can avoid it entirely by preferring ECDHE cipher suites, which need no dhparam file.
Fixed it? Catch the next one before your visitors do — monitor the certificate from outside, 3 free, no card.