-
Notifications
You must be signed in to change notification settings - Fork 66
Install rustls
's CryptoProvider
based on features
#171
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
base: master
Are you sure you want to change the base?
Install rustls
's CryptoProvider
based on features
#171
Conversation
Previously, we'd already assume `use-rustls` to use the default `aws-lc-rs` provider and `use-rustls-ring` to use the `ring` `CryptoProvider`, e.g., for `NoCertificateVerification`. However, we **wouldn't** actually install the respective provider based on the features, leading to a **reachable** panic at runtime when user tried to access `ssl://` Electrum servers. Here, we fix this omission and install the default provider according to the configured features.
FWIW, an alternative would be to introduce an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cACK 41c5228
I wasn't able to reproduce the panic locally. Do you have a specific scenario/impl that you could share?
I assume you're referring to the following panic: no process-level CryptoProvider available -- call CryptoProvider::install_default() before this point
That's produced by rustls::ClientConfig::get_default_or_install_from_crate_features
, is that right ?
It tries to install the default CryptoProvider
for the given process, and I wonder why it's not able to do it in your scenario, are you using ambiguous features ?
I don't see much problem with installing it explicitly based on the features, as it's also recommended by rustls
docs.
Yes:
In terms of bdk_electrum = { version = "0.23.0", default-features = false, features = ["use-rustls"]}
electrum-client = { version = "0.23.1", default-features = true, features = ["use-rustls"] }
bdk_esplora = { version = "0.22.0", default-features = false, features = ["async-https-rustls", "tokio"]}
esplora-client = { version = "0.12", default-features = false, features = ["tokio", "async-https-rustls"] }
esplora-client_0_11 = { package = "esplora-client", version = "0.11", default-features = false, features = ["tokio", "async-https-rustls"] }
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
lightning-transaction-sync = { version = "0.1.0", features = ["esplora-async-https", "time", "electrum"] } Indeed it seems we have both
Well, there is a slight problem in that it's recommended for binaries, while they suggest libraries to keep it open. However, as mentioned in the OP we already infringe on that for the |
Indeed, it seems like an okay fix for now, but ideally, we should move forward towards #137 and expose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 41c5228
Previously, we'd already assume
use-rustls
to use the defaultaws-lc-rs
provider anduse-rustls-ring
to use thering
CryptoProvider
, e.g., forNoCertificateVerification
.However, we wouldn't actually install the respective provider based on the features, leading to a reachable panic at runtime when user tried to access
ssl://
Electrum servers.Here, we fix this omission and install the default provider according to the configured features.
(cc @oleonardolima @thunderbiscuit)