gpt4 book ai didi

ssl - Astyanax 和 Cassandra 之间的安全通信

转载 作者:太空宇宙 更新时间:2023-11-03 12:49:47 25 4
gpt4 key购买 nike

有没有人想出一种方法来保护 Cassandra 和 Astyanax 客户端之间的通信?最好使用 SSL 来进行客户端证书身份验证 + 加密...

最佳答案

我将假设您已经在 cassandra 中启用了 SSL 并拥有 keystore 文件,如果不是 enabling SSL in Astyanax here. 上的完整博客的话

在构建 key 空间上下文时,您需要将 keystore 文件及其密码传递给 Astyanax:

AstyanaxContext<Keyspace> ctx = new AstyanaxContext.Builder()
.forKeyspace("MyKeyspace")
// Config parameters
.withConnectionPoolConfiguration(
new com.netflix.astyanax.connectionpool.impl.ConnectionPoolConfigurationImpl("MyConnectionPool")
.setSeeds("127.0.0.1")
.setSSLConnectionContext(
new SSLConnectionContext(
"/path/to/certificate/cassandra_external_trust.jks", // tell Astyanax the fully qualified path to the keystore file C* is using
"somePassword"))) // supply the keystore file's password too
.buildKeyspace(ThriftFamilyFactory.getInstance());
ctx.start();

关于ssl - Astyanax 和 Cassandra 之间的安全通信,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10998846/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com