{"record":{"id":"574064f92183fa7d","repo":"DioxusLabs/dioxus","slug":"https-is-enabled-but-cert-or-key-path-is-missing","errorCode":null,"errorMessage":"https is enabled but cert or key path is missing","messagePattern":"https is enabled but cert or key path is missing","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/serve/server.rs","lineNumber":662,"sourceCode":"    insert_no_cache_headers(response.headers_mut());\n\n    response\n}\n\npub(crate) fn insert_no_cache_headers(headers: &mut HeaderMap) {\n    headers.insert(CACHE_CONTROL, HeaderValue::from_static(\"no-cache\"));\n    headers.insert(PRAGMA, HeaderValue::from_static(\"no-cache\"));\n    headers.insert(EXPIRES, HeaderValue::from_static(\"0\"));\n}\n\nasync fn get_rustls(web_config: &WebHttpsConfig) -> Result<(String, String)> {\n    // If we're not using mkcert, just use the cert/key paths given to use in the config\n    if !web_config.mkcert.unwrap_or(false) {\n        if let (Some(key), Some(cert)) = (web_config.key_path.clone(), web_config.cert_path.clone())\n        {\n            return Ok((cert, key));\n        } else {\n            bail!(\"https is enabled but cert or key path is missing\");\n        }\n    }\n\n    const DEFAULT_KEY_PATH: &str = \"ssl/key.pem\";\n    const DEFAULT_CERT_PATH: &str = \"ssl/cert.pem\";\n\n    // Get paths to store certs, otherwise use ssl/item.pem\n    let key_path = web_config\n        .key_path\n        .clone()\n        .unwrap_or(DEFAULT_KEY_PATH.to_string());\n\n    let cert_path = web_config\n        .cert_path\n        .clone()\n        .unwrap_or(DEFAULT_CERT_PATH.to_string());\n\n    // Create ssl directory if using defaults","sourceCodeStart":644,"sourceCodeEnd":680,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/serve/server.rs#L644-L680","documentation":"Configuration guard in get_rustls (called from devserver_mainloop): HTTPS is enabled and mkcert is not in use, but the web config did not supply both a certificate path and a key path, so rustls cannot be constructed. The inputs at fault are the missing cert/key fields of the [web.https] configuration.","triggerScenarios":"Thrown at packages/cli/src/serve/server.rs:662 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["HTTPS is enabled but certificate paths are missing. Provide both the cert and key paths in the config."],"exampleFix":null,"handlingStrategy":"validation","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"}