Closed bahlo closed 1 year ago
That's a good idea, thanks for the suggestion. I personally only ever use reqwest with the default TLS feature, so I didn't even think about adding an option for using rustls 😅
The obvious way I'd implement an additional feature flag for dxr_client
would be like this:
reqwest
dependency of dxr_client
use default-features = False
default
feature to dxr_client
which depends on reqwest/default
rustls
feature to dxr_client
which depends on reqwest/rustls-tls
Though I'm not sure how to handle this in the top-level dxr
crate ... maybe like this?
dxr_client
dependency of dxr
use default-features = False
client-default-tls
feature that depends on dxr_client/default-tls
client-rustls-tls
feature that depends on dxr_client/default-tls
I have been thinking about splitting off the reqwest
client code into a separate crate (similar to how the server code is split into generic and axum-specific crates), which would probably make this whole thing easier.
What do you think?
Yeah, that's what I was thinking too. I started working on this in https://github.com/bahlo/dxr/tree/add-reqwest-tls-flags, but Cargo is unhappy — feel free to try it 👍
Can you take a look at this commit and see if that works for you? https://github.com/ironthree/dxr/commit/beb953c14bd5bdef22236d9ce80255dd5eb10b1e
If it looks good to you, I'll release a new version later.
Hi, yes that works! Thanks for taking care of this so quickly 🙏 Looking forward to the next version
Thanks for trying it out! I've published v0.5.3 on crates.io: https://crates.io/crates/dxr/0.5.3
Hi, I want to use your library on a system without OpenSSL so I need to use rustls.
Could we add a flag to get reqwest to use rustls?