Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(personhog): install rustls provider in the test harness (#79967)

Zach Brown37bf6f5996da
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
index f18decae06c0..32c523a5ab83 100644
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -8663,6 +8663,7 @@ dependencies = [
"personhog-proto",
"rand 0.8.5",
"rdkafka",
+ "rustls 0.23.37",
"serde_json",
"sqlx",
"tokio",
diff --git a/rust/personhog-test-harness/Cargo.toml b/rust/personhog-test-harness/Cargo.toml
index ed9c52361be9..dfd59d307a58 100644
--- a/rust/personhog-test-harness/Cargo.toml
+++ b/rust/personhog-test-harness/Cargo.toml
@@ -23,6 +23,7 @@ k8s-openapi = { version = "0.24", features = ["latest"] }
kube = { version = "0.98", features = ["client"] }
rand = { workspace = true }
rdkafka = { workspace = true }
+rustls = { version = "0.23", default-features = false, features = ["ring", "std"] }
serde_json = { workspace = true }
sqlx = { workspace = true }
tokio = { workspace = true }
diff --git a/rust/personhog-test-harness/src/main.rs b/rust/personhog-test-harness/src/main.rs
index be2cd95fd738..3132c11b47b0 100644
--- a/rust/personhog-test-harness/src/main.rs
+++ b/rust/personhog-test-harness/src/main.rs
@@ -17,6 +17,15 @@ use cli::{Cli, Command};
#[tokio::main]
async fn main() -> Result<()> {
+ // Install a process-wide rustls CryptoProvider before any TLS use.
+ // kube's client resolves it lazily, so without this the first chaos
+ // scenario's Kubernetes API call panics its worker while plaintext
+ // traffic carries on — chaos dies silently. Mirrors the leader and
+ // router mains.
+ rustls::crypto::ring::default_provider()
+ .install_default()
+ .expect("failed to install rustls ring CryptoProvider");
+
tracing_subscriber::fmt()
.with_env_filter(
EnvFilter::try_from_default_env()