I am using datastax cassandra version 3.6.0 and trying to connect to cassandra with ssl.
I have a ca cert already stored in dir "/etc/ssl/certs/cassandra.crt"
.
I have a cassandra cluster creation in JAVA as:
cluster = Cluster.builder().addContactPoints(hostArray).withPort(Integer.parseInt(port)).withCredentials(username, password).build();
I do see a with withSSL(SSLOptions)
in a builder,
How can I create a SSLOPtions in java with the above cert file such that I can use it to create a cluster?
In PYTHON I have
ssl_opts = {"ca_certs": "/etc/ssl/certs/cassandra.crt"}
auth_provider = PlainTextAuthProvider( username , password )
cluster = Cluster(
cluster_ips,
auth_provider=auth_provider,
port=20102,
ssl_options=ssl_opts,
load_balancing_policy=DCAwareRoundRobinPolicy()
)
How do I do the same with the crt file to create cluster in java?