问题描述
我正在重构API的客户端,该API通过安全连接进行通信。
在旧版本中,我使用CXF的FilterType
使用正则表达式删除不需要的密码套件
filter.getInclude().add(".*_WITH_DES_.*");
filter.getInclude().add(".*_WITH_NULL_.*");
// ...etc
params.setCipherSuitesFilter(filter);
http.setTlsClientParameters(params);
现在我正在使用spring-boot
和
io.netty.handler.ssl.SslContextBuilder
我看到它有
public SslContextBuilder ciphers(Iterable<String> ciphers,CipherSuiteFilter cipherFilter)
方法,我想知道如何正确使用CipherSuiteFilter
。
我的刺痛像这样
// the docs says that if the first argument is null then the default list of ciphers will be used/enabled
sslContextBuilder.ciphers(null,(ciphers,defaultCiphers,supportedCiphers) -> {
// implementation that takes all the default ciphers (how do i get them?) and filter them by regex
});
但是后来我发现SupportedCipherSuiteFilter
可以很好地过滤掉不需要的密码套件,但是事实是,过滤器的文档说
This class will filter all requested ciphers out that are not supported by the current {@link SSLEngine}.
这是SSLEngine的问题。我在哪里设置?还是应该使用其他方法?我有点困惑
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)