scylladb / scylla-cqlsh

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

usercert and userkey are loaded even if empty (None) #83

Closed fruch closed 2 months ago

fruch commented 2 months ago

when configuration doesn't define usercert or userkey

we fail as the following:

# cqlsh 127.0.0.1 9142 --ssl --debug
Using CQL driver: <module 'cassandra' from '/opt/scylladb/share/cassandra/libexec/../lib/scylla-driver-3.26.3.zip/cassandra/__init__.py'>
Using connect timeout: 5 seconds
Using 'utf-8' encoding
Using ssl: True
Using cloudconf: None
Traceback (most recent call last):
  File "/opt/scylladb/share/cassandra/libexec/cqlsh.py", line 2706, in <module>
    main(*read_options(sys.argv[1:], os.environ))
  File "/opt/scylladb/share/cassandra/libexec/cqlsh.py", line 2647, in main
    shell = Shell(hostname,
            ^^^^^^^^^^^^^^^
  File "/opt/scylladb/share/cassandra/libexec/cqlsh.py", line 490, in __init__
    kwargs['ssl_context'] = sslhandling.ssl_settings(hostname, CONFIG_FILE) if ssl else None
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scylladb/share/cassandra/libexec/../pylib/cqlshlib/sslhandling.py", line 89, in ssl_settings
    ssl_context.load_cert_chain(certfile=usercert,
TypeError: certfile should be a valid filesystem path