Fix tls-with-tokio-rustls compilation#46
Conversation
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
|
Hi @utopiabound, I am probably missing something, it's been a while since I looked at this code, but if I try the following I don't seem to have a problem connecting: $ gh pr checkout #46
$ cargo run --example demo --no-default-features --features tls-with-tokio-rustls -- --host google.com --port 443
Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.57s
Running `target/debug/examples/demo --host google.com --port 443`
[00:00:00.005] (7f880d103240) INFO Querying server properties..Would you perhaps be able to help me reproduce the issue? Thanks, Ximon |
|
I don't have a simple reproducer, but without this change both Workaround for my code was to add this call in main(): // Setup ring provider as default provider
_ = tokio_rustls::rustls::crypto::ring::default_provider().install_default(); |
The rustls docs say:
Which seems to say your workaround is actually the right thing to do. I'm not sure that this library should make the choice of either ring or aws_lc_rs for you. |
|
But it's not making the choice it's just not pulling in extra dependencies. The change just matches |
|
The question is why we pull in ring for rustls in the first place. I think we can depend only on tokio-rustls with |
|
Hi @utopiabound, My apologies for not responding sooner. Looking at how we pull in ring and use of features definitely makes sense to do. We've been and still are quite busy on getting Cascade ready for production release. Once we're less busy with that we'll come back to looking at this crate (which Cascade uses via Cascade-HSM-Bridge). Ximon |
|
PR #58 removes the default features for rustls and tokio-rustls. This means you have to specify the right rustls crypto feature when using the crate, which means you will have to add rustls as a dependency. However, all of this is going to change in rustls 0.24, when you have to explicitly provide a crypto provider when creating a client or server. So we will have to change all sorts of things then, anyway. Hopefully, this will be already on the |
This allows this to compile when used as below:
Otherwise both
ringandaws-lc-rsare included byrustlsand the binary dies with the following: