JDK-8301700 : Increase the default TLS Diffie-Hellman group size from 1024-bit to 2048-bit
  • Type: Enhancement
  • Component: security-libs
  • Sub-Component: javax.net.ssl
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-02-02
  • Updated: 2023-07-27
  • Resolved: 2023-02-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 17 JDK 21
11.0.21Fixed 17.0.9Fixed 21 b10Fixed
Related Reports
CSR :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8302171 :  
Description
The JDK implementation of TLS 1.2 uses a DH keysize of 1024 bits (chosen by the server) when a TLS_DHE cipher suite is negotiated and either the client or server does not support FFDHE to negotiate a stronger keysize.

1024-bit DH keys are known to be weak and are no longer recommended. Using this default should be rare under normal circumstances. A server or client would need to be configured such that no stronger suite is available that they both support and one or the other do not support FFDHE. The TLS_DHE cipher suites are lower in priority than other suites, and JDK implementations 8u261 and up all support FFDHE, which will only negotiate DH keys >= 2048 bits. But increasing this default size is still important, as a Java server may be negotiating with a non-Java TLS client that does not support FFDHE.

There was a concern in the past that some TLS clients may not support DH keys greater than 1024 bits, but this should now be very low risk. Most leading web browsers have deprecated the TLS_DHE suites so this should not be an issue. My testing shows no issues in the latest updates of JDK 6u and up, or OpenSSL 1.0.2 or later. JDK 1.5 was the last Java release that did not support DH keys greater than 1024-bits but that is a legacy release that has been unsupported for many years now. 

As a workaround, users can revert to the previous size by setting the "jdk.tls.ephemeralDHKeySize" system property to 1024 (at their own risk).

This issue does not affect TLS 1.3 as the minimum DH group size is 2048 bits.
Comments
[11u, 17u] Hi Alexey, this change is announced in the Cryptographic Roadmal for the release on 17.10.2023. https://www.java.com/en/jre-jdk-cryptoroadmap.html So please wait with backporting this for the next release. I remove the tags in the meantime. Thanks.
20-04-2023

Fix request (11u) I'd like to backport this enhancement to increase the security of the TLSv1.2 protocol. Backport is almost clean. The test is manually updated because of no JDK-8211018 in JDK11 All corresponding tests passed
19-04-2023

Fix request (17u) I'd like to backport this enhancement to increase the security of the TLSv1.2 protocol. Backport is almost clean and all corresponding tests passed
19-04-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/1835 Date: 2023-04-18 05:49:39 +0000
18-04-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/1256 Date: 2023-04-18 05:05:50 +0000
18-04-2023

Changeset: 26b111d7 Author: Sean Mullan <mullan@openjdk.org> Date: 2023-02-15 13:25:50 +0000 URL: https://git.openjdk.org/jdk/commit/26b111d714c3ee62bd10a5e2ab44be01c13ff42e
15-02-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/12502 Date: 2023-02-09 20:59:37 +0000
09-02-2023