如何在 Java 8 中将 DH 密钥大小扩展到 2048
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24502672/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to expand DH key size to 2048 in java 8
提问by user2192774
I read a lot of posts saying that in java 8 it is possible to expand the DH key size to 2048. They say it is possible from the system property by changing the value of:
jdk.tls.ephemeralDHKeySize
to 2048. I tried to figure out where and how to do this and could not find. Where can I find this variable or property? which file? path? I am using windows.
我读了很多帖子说在 java 8 中可以将 DH 密钥大小扩展到 2048。他们说可以通过将值更改jdk.tls.ephemeralDHKeySize
为 2048 来从系统属性中
实现。我试图找出在哪里以及如何这样做并找不到。我在哪里可以找到这个变量或属性?哪个文件?小路?我正在使用窗户。
采纳答案by Bruno
This is a system property, so you could set it via -Djdk.tls.ephemeralDHKeySize=2048
as a JVM argument or via System.setProperty
within the code. (I haven't checked for this property, but some properties are read only once by the library that uses them, and then cached permanently during the execution time of the JVM, so you'd generally want to set that setting early enough if you set it within the code.)
这是一个系统属性,因此您可以通过-Djdk.tls.ephemeralDHKeySize=2048
作为 JVM 参数或通过System.setProperty
在代码中进行设置。(我没有检查过这个属性,但有些属性只被使用它们的库读取一次,然后在 JVM 的执行期间永久缓存,所以如果你在代码中设置它。)
The acceptable values are documented in the JSSE reference guide: "Customizing Size of Ephemeral Diffie-Hellman Keys".