Hmbown/CodeWhale · error · anyhow::Error

TLS certificate verification cannot be disabled for provider

Error message

TLS certificate verification cannot be disabled for provider {}; configure SSL_CERT_FILE with a trusted custom CA bundle instead

What it means

The client does not support disabling TLS certificate verification (`insecure_skip_tls_verify`) for a provider; when that flag is set it logs a warning and bails. Users needing custom trust must supply a CA bundle via the SSL_CERT_FILE environment variable instead of turning verification off.

Solutions

  1. Remove `insecure_skip_tls_verify = true` from the provider config.
  2. Export SSL_CERT_FILE pointing to a CA bundle that includes the cert(s) you need trusted (e.g. the corporate proxy CA) and restart the client.
  3. If the endpoint uses a self-signed cert, add it to a CA bundle file and set SSL_CERT_FILE to that bundle.

Example fix

# before (config.toml)
[providers.corp-gateway]
base_url = "https://gw.internal"
insecure_skip_tls_verify = true

# after (shell)
export SSL_CERT_FILE=/path/to/corp-ca-bundle.pem
Defensive patterns

Strategy: validation

Validate before calling

fn check_tls_config(provider: &ProviderConfig) -> Result<(), String> {
    if provider.insecure_skip_tls_verify {
        return Err("use SSL_CERT_FILE with a custom CA bundle instead of disabling TLS verification".into());
    }
    Ok(())
}

Try / catch

match client_result {
    Err(e) if e.to_string().contains("TLS certificate verification cannot be disabled") => {
        eprintln!("Fix: unset insecure_skip_tls_verify and set SSL_CERT_FILE=<ca-bundle>");
    }
    _ => {}
}

Prevention

When it happens

Trigger: Setting `insecure_skip_tls_verify = true` (or an equivalent flag) on a provider config and starting the client; the check runs during client construction, before any request is sent.

Common situations: Corporate environments with TLS-intercepting proxies where users try to skip verification; self-signed certificates on internal gateways; copied config snippets enabling the flag.

Understand the failure class

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/c4a0733c290d6345. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/client.rs:1558

        logging::info(format!(
            "API base URL: {}",
            redact_url_for_display(&base_url)
        ));
        if let Some(suffix) = &path_suffix {
            logging::info(format!("API path suffix override: {suffix}"));
        }
        if !http_headers.is_empty() {
            logging::info(format!(
                "{} custom HTTP header(s) configured",
                http_headers.len()
            ));
        }
        if insecure_skip_tls_verify {
            logging::warn(format!(
                "TLS certificate verification cannot be disabled for provider {}; use SSL_CERT_FILE with a trusted custom CA bundle instead",
                api_provider.as_str()
            ));
            bail!(
                "TLS certificate verification cannot be disabled for provider {}; configure SSL_CERT_FILE with a trusted custom CA bundle instead",
                api_provider.as_str()
            );
        }
        logging::info(format!(
            "Retry policy: enabled={}, max_retries={}, initial_delay={}s, max_delay={}s",
            retry.enabled, retry.max_retries, retry.initial_delay, retry.max_delay
        ));
        if let Some(limit) = request_concurrency_limit {
            logging::info(format!(
                "Provider request concurrency cap: {} in-flight request(s)",
                limit
            ));
        }

        let http_client = Self::http_client_builder_with_auth_mode(
            &api_key,
            &http_headers,

View on GitHub (pinned to 73e0f67d83)