scylladb / scylla-cqlsh

A fork of the cqlsh code
Apache License 2.0
11 stars 29 forks source link

ssl behaviour with passphrase certs is broken #46

Closed tarzanek closed 10 months ago

tarzanek commented 10 months ago

scylla-cqlsh 6.0.11

when used with ssl:

$ .local/bin/cqlsh --ssl X.X.X.X
Enter PEM pass phrase:
Enter PEM pass phrase:
Enter PEM pass phrase:
Enter PEM pass phrase:
Enter PEM pass phrase:
Connected to XXXX at X.X.X.X:19142.
[cqlsh 6.0.11 | Scylla 2022.2.12-0.20230727.f4448d5b0265 | CQL spec 3.3.1 | Native protocol v4]
Use HELP for help.
cqlsh> Enter PEM pass phrase:

while original 2022.2.12 cqlsh works:

$ cqlsh --ssl $HOSTNAME
Enter PEM pass phrase:
Enter PEM pass phrase:
Connected to XXXX at X.X.X.X:19142.
[cqlsh 5.0.1 | Cassandra 3.0.8 | CQL spec 3.3.1 | Native protocol v4]
Use HELP for help.
cqlsh>
cqlsh> desc schema;
...

Scylla is of course enabled with SSL and certificates, client cqlshrc:

$ cat ~/.cassandra/cqlshrc
[cql]
version = 3.3.1
[connection]
hostname = X.X.X.X
port = 19142
#factory = cqlshlib.ssl.ssl_transport_factory
[ssl]
certfile = ~/TLS/root_ca.crt
validate = false
userkey = ~/TLS/scylla-server.key
usercert = ~/TLS/scylla-server.crt

local certificates are protected by a pass phrase

fruch commented 10 months ago

I can confirm I can see the same issue.

I think it's due the fact this now uses the shared aware driver with open more connections and might open then in parallel, which kind of break the UI which asks for the phrase.

fruch commented 10 months ago

switching to ssl context seems to be working much better (even then previous versions, since it would ask for it just once)