Hi, all.
Many thanks in advance for your time and consideration of the following issue.
I would file a Jira ticket, but when I click create, it tells me I'm not logged and to refresh the window, which doesn't work.
Bug summary: cassandra-driver falsely reports version error when it can't connect.
To the problem at hand:
We are testing a managed Cassandra instance inside of our Azure tenant. The test client host and all of the real clients are on the same subnet.
For this, the server version is [cqlsh 6.2.1 | Cassandra 4.0.12 | CQL spec 3.4.5 | Native protocol v5] and the driver version is 3.29.3.
Executing the following code:
auth_provider = PlainTextAuthProvider(
username=CASSANDRA_USERNAME,
password=CASSANDRA_PASSWORD
)
cluster = Cluster(
contact_points=[CASSANDRA_IP],
port=CASSANDRA_PORT,
auth_provider=auth_provider,
protocol_version=5
)
session = cluster.connect()
returned the error:
cassandra.cluster.NoHostAvailable: ('Unable to connect to any servers', {'10.20.6.92:9042': ProtocolError('This version of the driver does not support protocol version 21')}Which is absolutely not the case. What the problem turned out to be is that we needed to add:
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
ssl_context.check_hostname = False
ssl_context.verify_mode = ssl.CERT_NONEand later adding
ssl_context=ssl_context to the Cluster kwargs. Then everything works fine without error. The problem had nothing to do with protocol versions at all.
Best,
Glenn