epi052/feroxbuster · critical

Could not rebuild client

Error message

Could not rebuild client

What it means

try_rebuild_clients reconstructs the main HTTP client after configuration changes (timeouts, proxy, TLS material, server certs). client::initialize is unwrapped with expect, so any failure building the new reqwest client panics with 'Could not rebuild client'.

Solutions

  1. Verify the proxy URL format (scheme://host:port) and that any client cert/key files exist and are valid matching PEM pairs
  2. Check server certificate files are readable and valid PEM/DER
  3. Install CA certificates / fix the TLS environment, then retry

Example fix

// before
--proxy "localhost:8080" // missing scheme
// after
--proxy "http://localhost:8080"
Defensive patterns

Strategy: validation

Validate before calling

fn validate_client_config(cfg: &ClientConfig) -> Result<()> {
  if let Some(p) = &cfg.proxy { url::Url::parse(p)?; }
  for c in [&cfg.client_cert, &cfg.client_key].into_iter().flatten() { std::fs::read(c)?; }
  Ok(())
}

Try / catch

if let Err(_) = std::panic::catch_unwind(|| try_rebuild_clients(&mut config)) { eprintln!("rebuild failed: check proxy URL and cert files"); }

Prevention

When it happens

Trigger: Calling try_rebuild_clients with client settings that make reqwest's ClientBuilder::build() fail — invalid proxy URL, unreadable client cert/key files, malformed server certificate entries, or TLS backend errors.

Common situations: Pointing --proxy at a malformed URL, passing a PEM client certificate whose key doesn't match or can't be parsed, supplying a server certificate file that doesn't exist, or a TLS stack lacking required crypto provider.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of epi052/feroxbuster@1f595dab5c (2026-09-13). Data as JSON: /api/errors/934c049bdf03b2d3. Report an issue: GitHub.

Appendix: source

Thrown at src/config/container.rs:1275

            || configuration.resumed
            || !server_certs.is_empty()
            || client_cert.is_some()
            || client_key.is_some()
        {
            let client_config = client::ClientConfig {
                timeout: configuration.timeout,
                user_agent: &configuration.user_agent,
                redirects: configuration.redirects,
                insecure: configuration.insecure,
                headers: &configuration.headers,
                proxy,
                server_certs: Some(server_certs),
                client_cert,
                client_key,
                scope: &configuration.scope,
            };
            configuration.client =
                client::initialize(client_config).expect("Could not rebuild client");
        }

        if !configuration.replay_proxy.is_empty() {
            // only set replay_client when replay_proxy is set
            let client_config = client::ClientConfig {
                timeout: configuration.timeout,
                user_agent: &configuration.user_agent,
                redirects: configuration.redirects,
                insecure: configuration.insecure,
                headers: &configuration.headers,
                proxy: Some(&configuration.replay_proxy),
                server_certs: Some(server_certs),
                client_cert,
                client_key,
                scope: &configuration.scope,
            };
            configuration.replay_client =
                Some(client::initialize(client_config).expect("Could not rebuild client"));

View on GitHub (pinned to 1f595dab5c)