{"record":{"id":"ce5253b222f726da","repo":"Hmbown/CodeWhale","slug":"build-platform-http-client","errorCode":null,"errorMessage":"build platform HTTP client","messagePattern":"build platform HTTP client","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/release/src/tls.rs","lineNumber":17,"sourceCode":"//! Process-wide TLS bootstrap plus the platform HTTP client constructors that\n//! depend on it. Every reqwest client Codewhale builds goes through here so\n//! the rustls crypto provider is installed exactly once, before the first\n//! client, on every path (TUI, CLI, tests).\n\n/// Install the rustls `ring` crypto provider if no provider is installed yet.\n/// Idempotent; a second call is a no-op.\npub fn ensure_rustls_crypto_provider() {\n    let _ = rustls::crypto::ring::default_provider().install_default();\n}\n\n/// A ready platform HTTP client (provider installed, platform verifier).\npub fn reqwest_client() -> reqwest::Client {\n    ensure_rustls_crypto_provider();\n    reqwest_client_builder()\n        .build()\n        .expect(\"build platform HTTP client\")\n}\n\n/// The platform HTTP client builder, with the crypto provider installed.\npub fn reqwest_client_builder() -> reqwest::ClientBuilder {\n    ensure_rustls_crypto_provider();\n    crate::platform_http_client_builder()\n}\n\n/// The blocking platform HTTP client builder, with the crypto provider installed.\npub fn reqwest_blocking_client_builder() -> reqwest::blocking::ClientBuilder {\n    ensure_rustls_crypto_provider();\n    crate::platform_blocking_http_client_builder()\n}\n","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/release/src/tls.rs#L1-L31","documentation":"reqwest_client in release/src/tls.rs builds the platform HTTP client (rustls crypto provider installed, platform verifier) and .expect()s the build to succeed. A reqwest ClientBuilder build only fails on TLS backend initialization problems, so a panic here means the platform TLS setup is broken.","triggerScenarios":"Calling reqwest_client() when reqwest_client_builder().build() returns Err — e.g. rustls provider installation failed, TLS backend features missing, or an invalid platform verifier on an unusual OS build.","commonSituations":"Missing or conflicting rustls crypto provider features (aws-lc-rs vs ring), stripped-down container images lacking CA/TLS support, unsupported platform for the platform verifier.","solutions":["Ensure the rustls crypto provider feature (aws-lc-rs or ring) is enabled and no conflicting provider features are set.","Test reqwest_client_builder().build() directly and log the underlying error instead of panicking.","Verify the deployment image has the required TLS/CA support for the platform verifier."],"exampleFix":"// before\nlet client = release_tls::reqwest_client();\n// after\nlet client = release_tls::reqwest_client_builder()\n    .build()\n    .map_err(|e| anyhow!(\"TLS init failed: {e}\"))?;","handlingStrategy":"try-catch","validationCode":"// preflight TLS setup at startup\nlet _ = release_tls::reqwest_client_builder().build()?;","typeGuard":null,"tryCatchPattern":"let client = reqwest_client_builder().build()\n    .map_err(|e| anyhow::anyhow!(\"TLS client init failed: {e}\"))?;","preventionTips":["Enable exactly one rustls crypto provider feature (aws-lc-rs or ring).","Call reqwest_client_builder().build() once at startup to fail fast with a real error.","Verify target images/platforms support the platform verifier and CA loading."],"tags":["tls","http","panic","release"],"backgroundTag":"module-init-failed","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T21:17:16.096Z"}