jdx/mise · error

self_update.api_url must use HTTPS, got

Error message

self_update.api_url must use HTTPS, got {:?}

What it means

Self-update validates that the configured `api_url` uses the HTTPS scheme before making GitHub API requests. A non-HTTPS URL is rejected to avoid insecure update traffic (tokens/manifests over plaintext).

Solutions

  1. Change self_update.api_url to an https:// URL (e.g. https://api.github.com)
  2. If using a proxy/mirror, terminate TLS and expose it via https
  3. Fix scheme typos in the configured URL
  4. Remove the api_url override to fall back to the default HTTPS endpoint

Example fix

// before
self_update.api_url = "http://api.github.com"
// after
self_update.api_url = "https://api.github.com"
Defensive patterns

Strategy: validation

Validate before calling

const u = new URL(api_url);
if (u.protocol !== "https:") throw new Error(`api_url must use HTTPS, got ${api_url}`);

Try / catch

try {
  run_self_update()
} catch (e) {
  if (String(e).includes("must use HTTPS")) {
    console.error("Switch self_update.api_url to an https:// endpoint");
  } else throw e;
}

Prevention

When it happens

Trigger: Setting self_update.api_url to an http:// (or other scheme) URL and then running self-update paths (update_mise_shim, get_latest_version) which call validate().

Common situations: Pointing the updater at a local proxy or mirror with http://, enterprise GitHub instances configured with http, or a typo like 'htps://'.

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 jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/9e02fc42647212e9. Report an issue: GitHub.

Appendix: source

Thrown at src/cli/version.rs:83

    #[cfg(feature = "self_update")]
    pub(crate) fn repository_parts(&self) -> Result<(&str, &str)> {
        let (owner, repo) = self.repository.split_once('/').ok_or_else(|| {
            eyre::eyre!(
                "self_update.repository must be in owner/repository format, got {:?}",
                self.repository
            )
        })?;
        eyre::ensure!(
            !owner.is_empty() && !repo.is_empty() && !repo.contains('/'),
            "self_update.repository must be in owner/repository format, got {:?}",
            self.repository
        );
        Ok((owner, repo))
    }

    pub(crate) fn validate(&self) -> Result<()> {
        let api_url = url::Url::parse(&self.api_url)?;
        eyre::ensure!(
            api_url.scheme() == "https",
            "self_update.api_url must use HTTPS, got {:?}",
            self.api_url
        );
        Ok(())
    }
}

/// Display the version of mise
///
/// Displays the version, os, architecture, and the date of the build.
///
/// If the version is out of date, it will display a warning.
#[derive(Debug, usage_rs::Args)]
#[usage(
    verbatim_doc_comment,
    visible_alias = "v",
    example(

View on GitHub (pinned to 533346cc37)