-
Notifications
You must be signed in to change notification settings - Fork 110
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
scylla: Add support for rustls Fixes #293 #911
base: main
Are you sure you want to change the base?
Conversation
While implementing this, I noticed that
|
83ced31
to
6337af1
Compare
6337af1
to
589ba09
Compare
I'm not sure how to fix the |
Do we have some performance numbers to compare between the two implementations? |
As far as the implementations go, rustls is a bit faster than openssl as benchmarked here: https://jbp.io/2019/07/01/rustls-vs-openssl-performance.html
However I don't have the infrastructure to test the change in performance against a scylla cluster. |
I started to review this, but I decided against posting comments to specific fragments of code. I really like the idea of adding rustls support and we'd like such support to be part of 1.0. The approach I think should be taken is for Regarding hostnames problem - I'm not familiar with rustls, but if it's possible to edit the config after we receive it from user to disable this verification - I'm for it. Would you like to try implementing such solution, with our help? |
I strongly agree that our features should be additive.
I'm fine with the enum. trait SslProvider {
...
}
#[cfg(feature = ssl) // consider if putting this under feature is beneficial wrt performance
enum SslConfig {
#[cfg(feature = "rustls")
Rustls(RustlsProvider),
#[cfg(feature = "openssl")
Openssl(OpensslProvider),
// maybe a cfg here as well?
Custom(Arc(dyn CustomSslProvider),
}
impl SslProvider for RustlsProvider { ... }
impl SslProvider for OpensslProvider { ... }
impl SslProvider for SslConfig {
// match and use trait impl on any of the 3 enum variants
} |
In your example our functions would accept |
@Lorak-mmk @wprzytula I will take a look at this to move this forward if noone minds. Correct me if I'm wrong, but one problem with the trait + enum suggestion, if you look closely, is that there's SslContext (which is a different for openssl / rustls) stored in Session. And you can't have that Another question I had - in regards to feature names, it gets a bit confusing, should ssl be renamed to openssl? (a bit of a breaking change, of course) Does there need to be a separate ssl feature as well then, or perhaps not? (btw: I couldn't get dockerized tests working on a mac; docker compose up only launches one healthy node and then gets stuck...) |
This fell off for me as it wasn't clear if rustls was something scylla wanted to support. I see it has the waiting-on-author label now. w.r.t That said, I think changing |
I don't see why would there by any need for associated type in
I think the main reason for those features is to avoid pulling unnecessary dependencies. That means that the trait
Did you wait a few minutes? Launching Scylla takes some time. |
@Lorak-mmk As it's currently written, in Session you have an instance of an sslprovider-dependent type which is not the provider itself.
Yep, tried it all possible ways, and waited over 10 minutes, make up/down, nothing helps, sigh (I'm on an m1 mac, if that's any relevant). @nemosupremo Thanks for answering (and apologies for taking long to get back).
I think it makes sense for those present in this thread to jointly get this PR to completion in some way since it's more than halfway there already. To be frank I am barely familiar with either scylla or this particular codebase, so I'd definitely prefer it to be led by someone more knowledgeable than I am :) But if noone else wants or has time to, I could give it a try too, would really like to see it get merged in. Cheers. |
Could you share logs from Scylla? Either from the node that hangs at boot or from all 3. |
This PR adds support for rustls behind a feature. Rustls is a pure rust implementation of TLS. With this PR, it obviates the need for clients to install libssl separately, which can be advantageous for users who with to cross compile binaries or just want a simpler building process.
There is one breaking change:
cloud
feature no longer automatically pulls inssl
. Instead a compiler error is generated when thecloud
feature is enabled without eitherrustls
orssl
. A compiler error is also generated when bothrustls
andssl
are enabled.Concerning scylla cloud:
cloud
feature depend onssl
. I don't have any business mucking around in your guy's cloud code.Pre-review checklist
./docs/source/
.Fixes:
annotations to PR description.