gpt4 book ai didi

ssl - 从 cqlsh 通过 SSL 连接到 Cassandra (2.1.0)

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

我在 Debian 7.6.0 上运行 cassandra 2.1.0,在同一台机器上运行 cqlsh。当我尝试通过 cqlsh 连接时,

$/usr/local/cassandra-2.1.0/bin/cqlsh --ssl --debug

我收到以下错误消息:

Using CQL driver: <module 'cassandra' from '/usr/local/cassandra-2.1.0/bin/../lib/cassandra-driver-internal-only-2.1.0.post.zip/cassandra-driver-2.1.0.post/cassandra/__init__.py'>
Connection error: ('Unable to connect to any servers', {'127.0.0.1': SSLError(0, '_ssl.c:340: error:00000000:lib(0):func(0):reason(0)')})

详情如下。请。让我知道如何解决这个问题。提前致谢。

服务器端

如 ( http://www.datastax.com/documentation/cassandra/2.1/cassandra/security/secureSSLCertificates_t.html ) 中所述,我生成了一个 keystore 并修改了 cassandra.yaml,如下所示:client_encryption_options:

enabled: true

keystore: /usr/local/cassandra-2.1.0/ssl/.keystore

keystore_password: ***********

我已经导出了服务器的公钥。

客户端

将上一步导出的公钥复制到~/keys/cassandra_node0.cert。修改~/.cassandra/cqlshrc如下:

[connection]
hostname = 127.0.0.1
port = 9042
factory = cqlshlib.ssl.ssl_transport_factory

[tracing]
max_trace_wait = 10.0

[ssl]
certfile = ~/keys/cassandra_node0.cert
validate = true

最佳答案

我遇到了同样的问题

虽然您现在可能已经找到了解决方案,但我认为将解决方案记录下来对其他人可能会有所帮助。

我遵循了 here 中的文档创建一个 .pem 证书。

我的 cqlshrc ssl 配置如下所示

[ssl]
证书文件 =/ssl/cqlsh.pem
验证=假

这对我有用。

与 cassandra 文档中所有与 ssl 相关的主题一样,这部分内容涵盖得不够好。

关于ssl - 从 cqlsh 通过 SSL 连接到 Cassandra (2.1.0),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26521827/

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