Disable reqwest's default features#495
Conversation
825d06c to
0b90ac0
Compare
LLFourn
left a comment
There was a problem hiding this comment.
utACK 0b90ac0. I noticed this too but forgot to fix it. Thanks @thomaseizinger.
|
Concept ACK, but I would also add another feature to enable explicit https support (like |
|
@afilini good point. I don't think @thomaseizinger was trying to disable https completely. But if you disable default features I guess that's what happens. I think we should just add |
I generally agree with this but reqwest has a lot of TLS related features: https://github.com/seanmonstar/reqwest/blob/baffb9c004fbd4fb235046683edb3f86ab74596b/Cargo.toml#L31-L43 I don't think it is worth it passing all those through and we would have to do that if we don't want to be opinionated on either openssl or rustls which is the entire point of why I opened this PR :) |
|
To make it easier for existing users who want to keep the default reqwest behavior I think @afilini 's suggestion makes sense. I'd call it something like reqwest = { version = "0.11", optional = true, default-features = false, features = ["json"] }
# MUST ALSO USE `--no-default-features`
use-esplora-reqwest = ["esplora", "reqwest", "reqwest/socks", "futures"]
# Use below feature with `use-esplora-reqwest` to enable reqwest default TLS support
reqwest-default-tls = ["reqwest/default-tls"] |
0b90ac0 to
1afde05
Compare
|
Done! |
1afde05 to
5652704
Compare
There was a problem hiding this comment.
utACK 5652704
@thomaseizinger @notmandatory would it be better to include this feature operations somewhere in readme doc?
There is also this CI failure happening which I noticed in #497 too.
|
Restarted the CI jobs. The failure is still there. Weirdly its not happening in my local. |
|
Now that #501 is in you can rebase on |
5652704 to
773150c
Compare
Done. |
By default, reqwest uses openssl for TLS. Any consumer wanting to use rustls will thus pull in unnecessary dependencies. To make getting started with bdk and reqwest easier, we add a `reqwest-default-tls` feature that can be used to activate reqwest's `default-tls` feature. TLS is necessary for the esplora integration. Adding this feature makes it possible for people to use bdk with esplora without adding a reqwest dependency to their manifest.
773150c to
380a4f2
Compare
|
Rebased to fix conflicts. Is there something else blocking this from merging? |
@rajarshimaitra, the |
|
Ah I see.. Thanks @RCasatta will keep that in mind.. |
Description
By default, reqwest uses openssl for TLS. Any consumer wanting to use
rustls will thus pull in unnecessary dependencies.
Checklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features:
[ ] I've added tests for the new feature[ ] I've added docs for the new featureCHANGELOG.mdBugfixes:
[ ] This pull request breaks the existing API[ ] I've added tests to reproduce the issue which are now passing[ ] I'm linking the issue being fixed by this PR