abdolence / slack-morphism-rust

A modern async client library for Rust, supports Slack Web / Events API/Socket Mode and Block Kit.
https://slack-rust.abdolence.dev
Apache License 2.0
162 stars 58 forks source link

no process-level CryptoProvider available -- call CryptoProvider::install_default() before this point #286

Open Jonathan-Landeed opened 3 months ago

Jonathan-Landeed commented 3 months ago

Related to https://github.com/snapview/tokio-tungstenite/issues/336

I solved it by adding rustls = ">=0.23.x" to my Cargo.toml and let _ = rustls::crypto::aws_lc_rs::default_provider().install_default(); before calling slack morphism stuff, but that doesn't seem ideal.

abdolence commented 3 months ago

Hey, thanks for letting me know there are some issues. I've removed my Cargo.lock to verify it with the latest builds (rustls v0.27.2 there) and It seems working with socket_mode example without changing anything. I would guess it is related to some specific features configuration in your app?

Jonathan-Landeed commented 3 months ago

I think it might be when tonic v0.12.1 enables the ring feature, but I'm a bit over my head on this.

I also have multiple versions of rustls installed because aws-smithy-runtime is still on rustls v0.21.12, but that shouldn't matter.

jiangxiaoqiang commented 1 month ago

add this code to fixed this:

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