如何在 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 12:38:18  来源:igfitidea点击:

How to expand DH key size to 2048 in java 8

javasecurityssldiffie-hellman

提问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.ephemeralDHKeySizeto 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=2048as a JVM argument or via System.setPropertywithin 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".

可接受的值记录在JSSE 参考指南中:“自定义临时 Diffie-Hellman 密钥的大小