如何选择不同版本的 TLS 以实现与 Apache Cassandra 集群的安全客户端连接。集群运行 Cassandra 4.0 版。客户端应用程序使用 C# 的 Datastax 驱动程序。我的集群构建器代码与此类似(我已经清理了真实用户、密码、IP 等):
Cluster.Builder().WithCredentials("keyspaceUser", "keyspacePassword")
.AddContactPoints("127.0.0.1, 128.0.0.1, 129.0.0.1")
.WithSSL(new SSLOptions()
.SetCertificateCollection(new X509Certificate2Collection
{
new X509Certificate2(certPath, "certificatePassword")
}
)
.SetRemoteCertValidationCallback(
(sender, certificate, chain, errors) => { return true; }
)
)
.WithLoadBalancingPolicy(new RoundRobinPolicy())
.Build();
我在 Cassandra 的 system.log 中看到的问题是:io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: error:100000f0:SSL routines:OPENSSL_internal:UNSUPPORTED_PROTOCOL
经过进一步分析,我发现客户端正在尝试使用已过时的 TLSv1,在 Java 1.8 中默认禁用。所以我的问题是如何在构建器中设置使用不同的 TLS 版本?
谢谢
最佳答案
SSLOptions
type 有一个构造函数,允许您指定要使用的 ssl 协议(protocol)。
关于ssl - Cassandra C# TLS 版本选择?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67690633/