Skip to content

web.https configuration - error: no process-level CryptoProvider available #3815

Open
@h0pes

Description

@h0pes

Problem
I cannot get web.https to work.
I do not know if this is a bug or some kind of error from my side, as I am very new to Dioxus.

When I run:
dx serve --platform web --target wasm32

I get the following error:

Created a new certificate valid for the following names 📜│
- "localhost"is already installed in the system trust store! 👍
- "::1"  The local CA is already installed in the Firefox and/or Chrome/Chromium trust store! 👍
- "127.0.0.1" The certificate is at "../certs/cert.pem" and the key at "../certs/key.pem" ✅
It will expire on 1 June 2027 🗓

thread 'tokio-runtime-worker' panicked at /home/marco/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.23.23/src/crypto/mod.rs:249:14:
no process-level CryptoProvider available -- call CryptoProvider::install_default() before this point
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at /home/marco/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dioxus-cli-0.6.3/src/serve/server.rs:163:21:
Could not receive a socket - the devtools could not boot - the port is likely already in use

(it is not an address error)

Steps To Reproduce

Steps to reproduce the behavior:

  • I have these configuration settings in Dioxus.toml

    [web.https]
    
    enabled = true
    mkcert = true
    cert_path = "../certs/cert.pem"
    key_path = "../certs/key.pem"
  • I have read the following issue (which seems to have fixed in 0.6.3) and tried to apply the suggestions found there and in the axum issue:
    rustls = { version = "0.23.12", default-features = false, features = ["logging","std","tls12","ring"]}
    axum-server = { version = "0.7.1", features = ["tls-rustls-no-provider"] }

  • I have added at the beginning of my backend main.rs (which compiles successfully) the following:

  • use rustls::crypto::ring::default_provider as rustls_provider;
    
      rustls_provider()
          .install_default()
          .expect("Failed to install rustls crypto provider");

Expected behavior

I would expect to be able to run the application over https

Screenshots

Environment:

  • Dioxus version: 0.6.3
  • Rust version: 1.8.5
  • OS info: Linux arch 6.13.4-arch1-1 x86_64 GNU/Linux
  • App platform: web

Questionnaire

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions