DioxusLabs/dioxus · error

failed to generate mkcert certificates

Error message

failed to generate mkcert certificates

What it means

Raised in get_rustls (called from devserver_mainloop) when generating local dev certificates via the mkcert subprocess fails — covering spawn errors other than binary-not-found (which is logged separately with install instructions) as well as the certificate generation not producing the expected cert/key files. The input at fault is the mkcert invocation/installed version on the host.

Source

Thrown at packages/cli/src/serve/server.rs:708

            "-cert-file",
            &cert_path,
            "localhost",
            "::1",
            "127.0.0.1",
        ])
        .spawn();

    match cmd {
        Err(e) => {
            match e.kind() {
                io::ErrorKind::NotFound => {
                    tracing::error!(dx_src = ?TraceSrc::Dev, "`mkcert` is not installed. See https://github.com/FiloSottile/mkcert#installation for installation instructions.")
                }
                e => {
                    tracing::error!(dx_src = ?TraceSrc::Dev, "An error occurred while generating mkcert certificates: {}", e.to_string())
                }
            };
            bail!("failed to generate mkcert certificates");
        }
        Ok(mut cmd) => {
            cmd.wait().await?;
        }
    }

    Ok((cert_path, key_path))
}

/// Middleware that intercepts html requests if the status is "Building" and returns a loading page instead
async fn build_status_middleware(
    state: State<SharedStatus>,
    request: Request,
    next: Next,
) -> axum::response::Response {
    // If the request is for html, and the status is "Building", return the loading page instead of the contents of the response
    let accepts = request.headers().get(hyper::header::ACCEPT);
    let accepts_html = accepts

View on GitHub (pinned to 24f6a829df)

Solutions

  1. mkcert could not generate certificates. Install mkcert, run mkcert -install, and retry.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at packages/cli/src/serve/server.rs:708 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of DioxusLabs/dioxus@24f6a829df (2026-08-23). Data as JSON: /api/errors/39b65c3c9c1b1eb6. Report an issue: GitHub.