Skip to content

CryptoProvider error. #3619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

vgobbo
Copy link
Contributor

@vgobbo vgobbo commented Jan 22, 2025

When running dx serve, the following error happens since axum-server version 0.7 and rustls version 0.23.13.

thread 'tokio-runtime-worker' panicked at /home/vgobbo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.23.21/src/crypto/mod.rs:249:14:
no process-level CryptoProvider available -- call CryptoProvider::install_default() before this point
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::option::expect_failed
   3: rustls::server::server_conn::ServerConfig::builder_with_protocol_versions
   4: rustls::server::server_conn::ServerConfig::builder
   5: axum_server::tls_rustls::config_from_der
   6: axum_server::tls_rustls::config_from_pem
   7: dx::serve::server::devserver_mainloop::{{closure}}
   8: tokio::runtime::task::core::Core<T,S>::poll
   9: tokio::runtime::task::harness::Harness<T,S>::poll
  10: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
  11: tokio::runtime::scheduler::multi_thread::worker::Context::run
  12: tokio::runtime::context::runtime::enter_runtime
  13: tokio::runtime::scheduler::multi_thread::worker::run
  14: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll

As suggested in the bug axum-server#153, the workaround for this is to add feature tls-rustls-no-provider to axum-server, and add ring to rustls (not needed since the top-level Cargo.toml already does this).

@vgobbo vgobbo requested a review from a team as a code owner January 22, 2025 00:20
@jkelleyrtp jkelleyrtp merged commit ce2b223 into DioxusLabs:main Jan 22, 2025
17 checks passed
@jkelleyrtp
Copy link
Member

Thank yoU!

@vgobbo
Copy link
Contributor Author

vgobbo commented Feb 3, 2025

I see this was reverted by [1]. Why was it reverted?

dioxus-cli doesn't work without it when using HTTPS, which is pretty much a requirement nowadays with modern browsers even during development.

Can you provide an alternative?

[1] 5d48934

@h0pes
Copy link

h0pes commented Mar 2, 2025

@vgobbo Sorry to tag you, did you found a workaround or solution for this problem? Thanks a lot

@vgobbo
Copy link
Contributor Author

vgobbo commented Mar 2, 2025

@h0pes The workaround was the one in the MR, which got reverted for some reason. I've been using a fork with this patch since then.

@h0pes
Copy link

h0pes commented Mar 3, 2025

@vgobbo thanks for your reply. I was wondering whether no one is developing with https enabled...
@jkelleyrtp Is there any plan to fix this issue (if it is an issue)? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants