: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(cdp): match recording-api tls posture for cdp-rerun-worker clickhouse client (#67197)
Daniel Marchukf67e51fdffa1
diff --git a/nodejs/src/cdp/consumers/cdp-rerun-worker.consumer.ts b/nodejs/src/cdp/consumers/cdp-rerun-worker.consumer.tsindex 26c96e1bd6cb..b723dfca262e 100644--- a/nodejs/src/cdp/consumers/cdp-rerun-worker.consumer.ts+++ b/nodejs/src/cdp/consumers/cdp-rerun-worker.consumer.ts@@ -64,13 +64,9 @@ export class CdpRerunWorkerConsumer extends CdpConsumerBase<PluginsServerConfig>await this.jobQueues.hog_function.startAsProducer()await this.jobQueues.hog_flow.startAsProducer()- // Dedicated ClickHouse client for the paginator. The cluster's certs- // are issued for an internal hostname that doesn't match the one we- // dial in (`CLICKHOUSE_HOST` is typically a service-discovery name),- // so we override `checkServerIdentity` to no-op the hostname check- // while leaving the rest of the chain — signature, CA trust, expiry —- // verified. This is a narrower bypass than `rejectUnauthorized: false`,- // which would accept any cert from any signer.+ // Dedicated ClickHouse client for the paginator. Internal ClickHouse+ // uses self-signed certs with a hostname mismatch, same as the+ // session-replay recording-api client.const chScheme = this.config.CLICKHOUSE_SECURE ? 'https' : 'http'const chPort = this.config.CLICKHOUSE_SECURE ? 8443 : 8123this.clickhouseClient = createClickHouseClient({@@ -82,12 +78,7 @@ export class CdpRerunWorkerConsumer extends CdpConsumerBase<PluginsServerConfig>max_open_connections: 10,...(this.config.CLICKHOUSE_SECURE? {- http_agent: new https.Agent({- keepAlive: true,- maxSockets: 10,- // Hostname-only bypass — full chain validation still runs.- checkServerIdentity: () => undefined,- }),+ http_agent: new https.Agent({ rejectUnauthorized: false, keepAlive: true, maxSockets: 10 }), // nosemgrep: problem-based-packs.insecure-transport.js-node.bypass-tls-verification.bypass-tls-verification}: {}),})