How to increase DH key size to 2048 in java 8

I read a lot of posts that in java 8 you can expand the DH key size to 2048. They say that this is possible from the system property by changing the value: jdk.tls.ephemeralDHKeySize to 2048. I tried to figure out where and how to do it, and could not find. Where can I find this variable or property? which file? track? I use windows.

+4
source share
1 answer

This is a system property, so you can set it via -Djdk.tls.ephemeralDHKeySize=2048 as a JVM argument or through System.setProperty in the code. (I have not tested this property, but some properties are read only once by the library that uses them, and then are cached constantly during the JVM run, so you would usually want to set this parameter early enough if you set it to code.)

Valid values ​​are documented in the JSSE Reference Guide : "Setting the Size of the Diffie-Hellman Ephemeral Keys . "

+6
source

All Articles