Cassandra的cqlsh无法连接到任何服务器:上一个错误:[SSL]内部错误_ssl.c:727“

问题描述

由于先前突然工作的docker部署集群停止接受任何连接:

cqlsh --debug --ssl -u <username> -p <username>
...
Using CQL driver: <module 'cassandra' from '/opt/cassandra/bin/../lib/cassandra-driver-internal-only-3.11.0-bb96859b.zip/cassandra-driver-3.11.0-bb96859b/cassandra/__init__.py'>
Using connect timeout: 300 seconds
Using 'utf-8' encoding
Using ssl: True
Connection error: ('Unable to connect to any servers',{'172.X.X.X': error(1,u"Tried connecting to [('172.X.X.X',9042)]. Last error: [SSL] internal error (_ssl.c:727)")})

在节点方面,没有例外。

这是 不是 网络问题,因为不带--ssl选项的连接会导致cassandra节点上出现io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record...异常(这意味着它看到了主机并可以与其通信)。

或多或少清楚的是问题出在用于身份验证的证书上。

有什么方法可以获取有关潜在错误的更多详细信息吗?

PS:使用已切换为ubuntu-focus的cassandra 3.11.9映像时,会发生此问题:https://github.com/docker-library/cassandra/commit/8b1427f0670684b13e58006c0bf46df18a01ee0b 使用cassandra 3.11.7时,一切运行正常

解决方法

似乎Cassandra 3.11.8+需要更新版本的TLS。在cqlsh客户端配置中强制执行此操作会有所帮助(请参见How to force SSL TLSv1.2 protocol with DSE)。

[connection]
(...)
factory = cqlshlib.ssl.ssl_transport_factory
ssl = true

[ssl]
(...)
version = SSLv23