dbt-clickhouse icon indicating copy to clipboard operation
dbt-clickhouse copied to clipboard

Add ca_cert credential for http connection

Open viktor-ozherelev opened this issue 7 months ago • 2 comments

We connect to a Managed ClickHouse cluster whose server certificate is signed by an internal/Yandex Root CA.

clickhouse-connect supports a file-path argument ca_cert that lets a client trust such a certificate chain. The dbt-clickhouse credential schema, however, exposes only the boolean flag verify and it is not possible to add ca_cert .pem file like in clickhouse_connect.

Proposal: add an optional string field ca_cert to class ChHttpClient._create_client:

return clickhouse_connect.get_client(
    ...,
    verify=credentials.verify,
    ca_cert=credentials.ca_cert
)

viktor-ozherelev avatar May 19 '25 23:05 viktor-ozherelev

May be my problem related with this... I use verify=True and secure=True in my profile.yml, but don't use client_cert like in example dbt-clickhouse profile. When i run "dbt test" my connection is OK, but i expect different behavior with error is referencing to SSL

mmjoke avatar May 20 '25 12:05 mmjoke

The same problem with connection to Yandex Cloud Managed ClickHouse. @viktor-ozherelev have you found a workaround to pass ca_cert to profiles?

Disimasa avatar May 30 '25 11:05 Disimasa