Search code examples
pythonclickhouse

How to connect to Clickhouse with SSL-on in Python?


I trying connect to Clickhouse database in Python with pandahouse . In Dbeaver my connection settings:

host: **.***.**.***
port: 8443
database: db_name
user: user_name
password: ***
SSH: off
SSL: on
SSl mode: None

How to add SSL - setting to pandahouse connection?

I've also tryed clickhouse_connect, but don't get how to add SSL to connection.


Solution

  • I figure out, how to make this connection. At least it's work in my case.

    import clickhouse_connect
    connect = clickhouse_connect.get_client(
        interface='https'
        , host = '*.*.*.*'
        , port = 8443
        , database = 'database_name'
        , username = 'user'
        , password = 'password'
        , secure = 'https'
        , verify = 'True'
        , server_host_name = 'database_host_name.com'
        )