所有 IBM 密码套件名称都以 SSL_ 开头,尽管标准规定有些密码套件名称应以 TLS_ 开头。是否有一个选项可以让 JVM 使用标准名称,这样我就不必创建特殊的包含/排除规则来让 Jetty 9 使用 SSL?以下链接中提到了执行此操作的选项,但我找不到任何关于选项名称是什么或如何设置它的文档。 https://github.com/eclipse/jetty.project/issues/2921
最佳答案
IBM J9 JVM 仅在声明要使用的密码套件的精确列表时才允许与 RFC 名称互操作。
换句话说,它永远不会返回支持列表中的 RFC 名称,但会在您声明要使用的内容时使用 RFC 名称。
IBM J9 JVM 的这一决定与许多项目不兼容。
使用 IBM J9 JVM 时,您必须声明要与在 IBM J9 JVM 上使用 SSLEngine 的任何产品一起使用的完整密码套件列表。 (HTTP 客户端、WebSocket 客户端、REST 客户端、HTTP 服务器等...)
在 Jetty 上,您需要创建自定义 SslContextFactory
以 IBM J9 JVM 方式运行,而不是使用 RFC 名称模式进行包含/排除。覆盖以下方法并以您的 IBM J9 JVM 方式实现它。
public SSLParameters customize(SSLParameters sslParams)
{
super.customize(sslParams);
_selectedCipherSuites = // String[] of selected cipher suites on IBM J9
sslParams.setCipherSuites(_selectedCipherSuites);
}
另一种更有益的方法是创建一个新的注册安全提供程序(比如“myIbmRFC”),它可以返回一个使用 RFC 名称的 SSLContext
。
它必须支持......
String protocol = "TLS";
String provider = "myIbmRFC";
SSLContext context = SSLContext.getInstance(protocol, provider);
context.init(....); // read javadoc about this
SSLParameters enabled = context.getDefaultSSLParameters();
SSLParameters supported = context.getSupportedSSLParameters();
// these two should return RFC names (a mapping between IBM and RFC)
String[] enabledCipherSuites = enabled.getCipherSuites();
String[] supportedCipherSuites = supported.getCipherSuites();
Note: You cannot use HTTP/2 on IBM J9 JVM. The
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
Cipher that is mandated by the RFC cannot be discovered, so it winds up failing the HTTP/2 initialization. If you do manage to get past this, then the list of Blacklisted Cipher Suites from the HTTP/2 RFC use the RFC names as well, and cannot be overridden, so that will increase your likelyhood of generating aINADEQUATE_SECURITY
from the remote endpoint to a near certainty as you will be using a blacklisted Cipher suite that wasn't excluded by Jetty's HTTP/2 layer.
关于java - 有没有办法让 IBM JVM 使用标准的 RFC 密码套件名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58857846/