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
- Change self_update.api_url to an https:// URL (e.g. https://api.github.com)
- If using a proxy/mirror, terminate TLS and expose it via https
- Fix scheme typos in the configured URL
- 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
- Only configure https:// endpoints for update APIs
- Front any http proxy/mirror with TLS
- Avoid overriding api_url unless necessary
- Validate URLs with a scheme check in config linting
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
- remote cache URL must use HTTPS except for loopback…
- GitHub Actions OIDC request URL must use HTTPS
- install_mise must not contain '..
- invalid repository origin
- no trusted public keys available for verification
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)