gpt4 book ai didi

java - Cassandra:如何设置客户端到节点的加密?

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:21:34 25 4
gpt4 key购买 nike

我已经使用 DataStax guide 设置了 Cassandra 客户端到节点的加密

来自 cassandra.yaml 文件的 Client_encription_options:

 client_encryption_options:
enabled: true
keystore: /opt/key/.keystore
keystore_password: cassandra
cipher_suites:[TLS_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA]

客户端使用 SSL 的默认 Java 系统属性:

-Djavax.net.ssl.trustStore=/opt/app/conf/.truststore -Djavax.net.ssl.trustStorePassword=cassandra    

但是连接后在 Cassandra 日志中出现错误:

INFO [Native-Transport-Requests:12] 2015-02-11 11:45:52,456 Message.java (line 397) Unexpected exception during request; channel = [id: 0xfb3df0e3, /192.168.43.13:32885 => /192.168.43.10:9042]
org.jboss.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: 01000001000000160001000b43514c5f56455253494f4e0005332e302e30
at org.jboss.netty.handler.ssl.SslHandler.decode(SslHandler.java:871)
at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:425)
at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:109)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:90)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

我使用的是 Cassandra 2.0.10.71,Java 1.7.0_75 和 Java 加密扩展库

最佳答案

这是一条信息消息,表明已为您的 Cassandra 节点设置了无 ssl 包。似乎有东西试图连接到您的 Cassandra 节点。

查看引发异常的 Netty java 文件的源代码。 org.jboss.netty.handler.ssl.SslHandler.decode(SslHandler.java:871)

  if (nonSslRecord) {
// Not an SSL/TLS packet
NotSslRecordException e = new NotSslRecordException(
"not an SSL/TLS record: " + ByteBufUtil.hexDump(in));
in.skipBytes(in.readableBytes());
ctx.fireExceptionCaught(e);
setHandshakeFailure(ctx, e);
}

http://grepcode.com/file/repo1.maven.org/maven2/io.netty/netty-handler/4.0.30.Final/io/netty/handler/ssl/SslHandler.java#SslHandler

https://issues.jboss.org/browse/NETTY-301

关于java - Cassandra:如何设置客户端到节点的加密?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28457428/

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