Stoyan Bukovich
Stoyan Bukovich

Reputation: 87

Cassandra C# TLS version selection?

How can I select different version of TLS for secure client connection to Apache Cassandra cluster. The cluster is running Cassandra version 4.0. The client application is using Datastax driver for C#. My cluster builder code looks similar to this (I've cleaned-up real user, password, IPs etc.):

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();

The problem I am facing which I can see in Cassandra's system.log is:

io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: error:100000f0:SSL routines:OPENSSL_internal:UNSUPPORTED_PROTOCOL

After further analysis I could find that the client is trying to use TLSv1 which is obsolete and by default disabled in Java 1.8.

So my question is how I can set in the builder to use different TLS version?

Thanks

Upvotes: 2

Views: 363

Answers (1)

João Reis
João Reis

Reputation: 712

The SSLOptions type has a constructor that allows you to specify which ssl protocol to use.

Upvotes: 1

Related Questions