scylladb / python-driver

ScyllaDB Python Driver, originally DataStax Python Driver for Apache Cassandra
https://python-driver.docs.scylladb.com
Apache License 2.0
70 stars 42 forks source link

Asyncio backend: SSL doesn't work #330

Open Lorak-mmk opened 2 months ago

Lorak-mmk commented 2 months ago

When using AsyncioConnection it's not possible to connect to Scylla using SSL - the connection hangs and eventually timeouts. The issue is that asyncio methods like sock_sendall don't work with SSLSocket - they explicitly check the type of the socket here (definition of this function) Another issue is that this exception is swallowed somewhere, so we don't see it in the terminal - there probably should be a catch-all block that prints the exception.

The solution would probably be to rework AsyncioConnection.__init__ and other methods a bit to use https://docs.python.org/3/library/asyncio-stream.html#asyncio.open_connection