jdx/mise · error

remote cache URL must use HTTPS

Error message

remote cache URL must use HTTPS

What it means

validate_remote_url rejects cache base URLs that are neither HTTPS nor plain HTTP. Any other scheme (ftp:, file:, ws:, etc.) cannot be used for the remote cache and produces this error before any request is made.

Solutions

  1. Set the cache URL to https://cache.example.com
  2. For local development, http://localhost:<port> is permitted
  3. Remove an accidental file:// or ftp:// prefix and use a proper HTTP(S) cache server
  4. Check the config key you set — you may have put the cache dir path into the URL field

Example fix

// before (config)
MISE_CACHE_REMOTE_URL=ftp://cache.example.com
// after
MISE_CACHE_REMOTE_URL=https://cache.example.com
Defensive patterns

Strategy: validation

Validate before calling

let url = Url::parse(cache_url)?;
assert!(matches!(url.scheme(), "https" | "http"), "cache URL must be http(s)");

Type guard

fn is_http_scheme(url: &Url) -> bool {
    matches!(url.scheme(), "https" | "http")
}

Try / catch

match validate_remote_url(&url, authenticated) {
    Err(e) if e.to_string().contains("must use HTTPS") => {
        eprintln!("fix the scheme of MISE_CACHE_REMOTE_URL");
    }
    other => other,
}

Prevention

When it happens

Trigger: Calling validate_remote_url with a Url whose scheme is not "https" and not "http" — for example ftp://cache.example.com, file:///cache, or a scheme-less value parsed into an unexpected scheme.

Common situations: Typo in the cache URL scheme in mise.toml or environment config, pasting a local filesystem path where a URL is expected, using a ws:// endpoint from another tool's config.

Understand the failure class

Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/66e3765bff213e50. Report an issue: GitHub.

Appendix: source

Thrown at crates/mise-cache-core/src/lib.rs:1112

        || url.scheme() == "http"
            && url.host().is_some_and(|host| match host {
                Host::Domain(host) => host.eq_ignore_ascii_case("localhost"),
                Host::Ipv4(address) => address.is_loopback(),
                Host::Ipv6(address) => address.is_loopback(),
            })
    {
        Ok(())
    } else {
        bail!("GitHub Actions OIDC request URL must use HTTPS")
    }
}

fn validate_remote_url(base_url: &Url, authenticated: bool) -> Result<()> {
    if base_url.scheme() == "https" {
        return Ok(());
    }
    if base_url.scheme() != "http" {
        bail!("remote cache URL must use HTTPS");
    }
    let is_loopback = base_url.host().is_some_and(|host| match host {
        Host::Domain(host) => host.eq_ignore_ascii_case("localhost"),
        Host::Ipv4(address) => address.is_loopback(),
        Host::Ipv6(address) => address.is_loopback(),
    });
    if !is_loopback && authenticated {
        bail!("remote cache URL must use HTTPS except for loopback development servers");
    }
    if !is_loopback {
        warn!(
            "using an unauthenticated remote build cache over plain HTTP; cache traffic can be read \
             or modified in transit"
        );
    }
    Ok(())
}

View on GitHub (pinned to 533346cc37)