ironthree / dxr

Declarative XML-RPC in Rust
Apache License 2.0
17 stars 8 forks source link

Add support for rustls #4

Closed bahlo closed 1 year ago

bahlo commented 1 year ago

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?

decathorpe commented 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:

Though I'm not sure how to handle this in the top-level dxr crate ... maybe like this?

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?

bahlo commented 1 year ago

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 👍

decathorpe commented 1 year ago

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.

bahlo commented 1 year ago

Hi, yes that works! Thanks for taking care of this so quickly 🙏 Looking forward to the next version

decathorpe commented 1 year ago

Thanks for trying it out! I've published v0.5.3 on crates.io: https://crates.io/crates/dxr/0.5.3