1

A security audit I just ran turned up that we are using a sub-par key strength (recommended 2048 or higher, ours is 1024 bits) for the Diffie-Hellman groups (TLS). Upon researching I found that starting JDK 8 we can set the DH key size to be 2048. All the options suggested in How to expand DH key size to 2048 in java 8 apply to Oracle JDK and they do work for that.

However, when I try to set -Djdk.tls.ephemeralDHKeySize=2048 as JVM argument on my Ubuntu with OpenJDK 8 it is still remaining to be 1024 bits. Any help is appreciated.

MWiesner
  • 8,868
  • 11
  • 36
  • 70
user3688037
  • 67
  • 5
  • 10
  • I don't think you can, see http://serverfault.com/a/722254/216617 Can you switch to [Oracle JDK](https://launchpad.net/~webupd8team/+archive/ubuntu/java)? – Elliott Frisch Apr 06 '17 at 21:46
  • The comment you mentioned talks about glassfish which jdk 7. I am on OpenJDK 8 which is theotrically inline with Oracle JDK 8. Am I missing something? I would hate to switch to Oracle JDK just for this one thing – user3688037 Apr 06 '17 at 21:53
  • 2
    OpenJDK 8 should definitely support `jdk.tls.ephemeralDHKeySize`. Here's the [change that added that support to OpenJDK 8](http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/0d5f4f1782e8). Can you provide more details? What version of OpenJDK 8 are you using? How are you verifying the key size? What happens if you set the key size to, say, 65500 instead of 2048? – omajid Apr 07 '17 at 02:24
  • java -version openjdk version "1.8.0_72-internal" OpenJDK Runtime Environment (build 1.8.0_72-internal-b05) OpenJDK 64-Bit Server VM (build 25.72-b05, mixed mode) I added -Djdk.tls.ephemeralDHKeySize=2048 as JVM arg. When I run the security audit reports on the OpenJDK instance it says, I am still using 1024 bits. Whereas on the Oracle JDK 1.8.0.72 instance, the key size violation is being handled after adding jvm arg. – user3688037 Apr 07 '17 at 18:18

1 Answers1

2

This is not an issue on latest JDK versions, I have verified on JDK 9.0.4 and JDK 10. As stated in the comments of the bug report : The jdk.tls.ephemeralDHKeySize property only has impact on the Server side handshaker code and as such, should be used on server side JVM.

In the latest Oracle JDK 8u161, this works if this option is set in server side. From JDK 9 onwards, the FFDHE is available and the property has an effect when set in client side.

Pallavi Sonal
  • 3,661
  • 1
  • 15
  • 19