{"record":{"id":"5a5dac4a7ac6e1a3","repo":"DioxusLabs/dioxus","slug":"failed-to-install-default-cryptoprovider-provide","errorCode":null,"errorMessage":"Failed to install default CryptoProvider: {provider:?}","messagePattern":"Failed to install default CryptoProvider: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/serve/server.rs","lineNumber":443,"sourceCode":"    listener: TcpListener,\n    router: Router,\n) -> Result<()> {\n    // We have a native listener that we're going to give to tokio, so we need to make it non-blocking\n    let _ = listener.set_nonblocking(true);\n\n    // If we're not using rustls, just use regular axum\n    if https_cfg.enabled != Some(true) {\n        axum::serve(\n            tokio::net::TcpListener::from_std(listener).unwrap(),\n            router.into_make_service(),\n        )\n        .await?;\n        return Ok(());\n    }\n\n    // If we're using rustls, we need to install the provider, get the cert/key paths, and then set up rustls\n    if let Err(provider) = CryptoProvider::install_default(default_provider()) {\n        bail!(\"Failed to install default CryptoProvider: {provider:?}\");\n    }\n    let (cert_path, key_path) = get_rustls(&https_cfg).await?;\n    let rustls = axum_server::tls_rustls::RustlsConfig::from_pem_file(cert_path, key_path).await?;\n\n    axum_server::from_tcp_rustls(listener, rustls)\n        .serve(router.into_make_service())\n        .await?;\n\n    Ok(())\n}\n\n/// Sets up and returns a router\n///\n/// Steps include:\n/// - Setting up cors\n/// - Setting up the proxy to the endpoint specified in the config\n/// - Setting up the file serve service\n/// - Setting up the websocket endpoint for devtools","sourceCodeStart":425,"sourceCodeEnd":461,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/serve/server.rs#L425-L461","documentation":"Initialization guard in devserver_mainloop (called from start): when HTTPS is enabled the server must install a default rustls CryptoProvider before constructing the TLS acceptor, and that process-level installation failed (e.g. no provider features enabled or a conflicting prior install). The input at fault is the CryptoProvider whose installation attempt is reported.","triggerScenarios":"Thrown at packages/cli/src/serve/server.rs:443 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No rustls CryptoProvider could be installed. Enable a provider feature (e.g. ring) or install one explicitly before use."],"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"}