{"record":{"id":"39b65c3c9c1b1eb6","repo":"DioxusLabs/dioxus","slug":"failed-to-generate-mkcert-certificates","errorCode":null,"errorMessage":"failed to generate mkcert certificates","messagePattern":"failed to generate mkcert certificates","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/serve/server.rs","lineNumber":708,"sourceCode":"            \"-cert-file\",\n            &cert_path,\n            \"localhost\",\n            \"::1\",\n            \"127.0.0.1\",\n        ])\n        .spawn();\n\n    match cmd {\n        Err(e) => {\n            match e.kind() {\n                io::ErrorKind::NotFound => {\n                    tracing::error!(dx_src = ?TraceSrc::Dev, \"`mkcert` is not installed. See https://github.com/FiloSottile/mkcert#installation for installation instructions.\")\n                }\n                e => {\n                    tracing::error!(dx_src = ?TraceSrc::Dev, \"An error occurred while generating mkcert certificates: {}\", e.to_string())\n                }\n            };\n            bail!(\"failed to generate mkcert certificates\");\n        }\n        Ok(mut cmd) => {\n            cmd.wait().await?;\n        }\n    }\n\n    Ok((cert_path, key_path))\n}\n\n/// Middleware that intercepts html requests if the status is \"Building\" and returns a loading page instead\nasync fn build_status_middleware(\n    state: State<SharedStatus>,\n    request: Request,\n    next: Next,\n) -> axum::response::Response {\n    // If the request is for html, and the status is \"Building\", return the loading page instead of the contents of the response\n    let accepts = request.headers().get(hyper::header::ACCEPT);\n    let accepts_html = accepts","sourceCodeStart":690,"sourceCodeEnd":726,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/serve/server.rs#L690-L726","documentation":"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.","triggerScenarios":"Thrown at packages/cli/src/serve/server.rs:708 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["mkcert could not generate certificates. Install mkcert, run mkcert -install, and retry."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}