Skip to content

fix(clickhouse): honor verify=false in the Rust HTTP writer - #8419

Open
bhataprameya wants to merge 1 commit into
getsentry:masterfrom
bhataprameya:fix/rust-consumer-clickhouse-verify
Open

fix(clickhouse): honor verify=false in the Rust HTTP writer#8419
bhataprameya wants to merge 1 commit into
getsentry:masterfrom
bhataprameya:fix/rust-consumer-clickhouse-verify

Conversation

@bhataprameya

@bhataprameya bhataprameya commented Aug 29, 2026

Copy link
Copy Markdown

Context

  • Rust consumers always verify ClickHouse TLS certificates, while the Python clients honor the cluster verify setting (CLICKHOUSE_VERIFY). With secure HTTPS and a self-signed/private-CA certificate, Rust consumers fail with certificate verify failed: unable to get local issuer certificate even when verification is explicitly disabled.

Changes

  • Serialize the cluster verify setting into the Rust consumer config (bool | None; raw env strings coerced, only explicit false/0 disable).
  • Rust writer builds reqwest with tls_danger_accept_invalid_certs + tls_danger_accept_invalid_hostnames only when secure && verify == Some(false).
  • Unset (None) keeps current behavior (verification on); plaintext HTTP and credentials/headers are unchanged.
  • Cluster builders keep an omitted verify key as None instead of False so "unset" stays distinct from "explicitly disabled" (both are falsy at existing Python call sites, so no behavior change).

Testing

  • cargo test --lib config:: — verify absent → None, explicit falseSome(false).
  • pytest tests/consumers/test_consumer_config.py — 15 passed (coercion matrix + propagation).
  • cargo clippy --all-targets -- -D warnings, cargo fmt --check, ruff, mypy: clean.

The Rust consumer writer always verified ClickHouse TLS certificates,
while the Python clients honor the cluster verify setting. Plumb verify
into the Rust consumer config and disable certificate and hostname
checks only for HTTPS when verify is explicitly false.
@bhataprameya
bhataprameya requested a review from a team as a code owner August 29, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant