Skip to content
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

Using rustls v22 and greater with quinn #1795

Closed
ReeceHumphreys opened this issue Mar 29, 2024 · 5 comments
Closed

Using rustls v22 and greater with quinn #1795

ReeceHumphreys opened this issue Mar 29, 2024 · 5 comments

Comments

@ReeceHumphreys
Copy link

The documentation shows an example of how to integrate rustls with quinn:

    let crypto = rustls::ClientConfig::builder()
        .with_safe_defaults()
        .with_custom_certificate_verifier(SkipServerVerification::new())
        .with_no_client_auth();

    ClientConfig::new(Arc::new(crypto))

However, the API for rustls has slightly changed and this example no longer seems to work:

        let crypto = rustls::ClientConfig::builder()
            .with_root_certificates(roots)
            .with_no_client_auth();


        quinn::ClientConfig::new(Arc::new(crypto));

Error:

error[E0277]: the trait bound `rustls::ClientConfig: quinn::crypto::ClientConfig` is not satisfied
  --> src/icerpc_connection.rs:38:54
   |
38 |         let client_config = quinn::ClientConfig::new(Arc::new(crypto));
   |                                                      ^^^^^^^^^^^^^^^^ the trait `quinn::crypto::ClientConfig` is not implemented for `rustls::ClientConfig`
   |
   = help: the trait `quinn::crypto::ClientConfig` is implemented for `rustls::client::client_conn::ClientConfig`
   = note: required for the cast from `Arc<rustls::ClientConfig>` to `Arc<(dyn quinn::crypto::ClientConfig + 'static)>`

Any help with resolving this would be greatly appreciated!

@ReeceHumphreys
Copy link
Author

I suspect #1715 would resolve my issue but I am looking for a workaround in the meantime if possible!

@djc
Copy link
Member

djc commented Mar 29, 2024

Look at the examples from any Git tags?

@djc
Copy link
Member

djc commented Mar 29, 2024

In general Quinn does not and will not support rustls 0.22. It will support rustls 0.23 after #1715 lands. If you want to get something working today, you can either use released Quinn with rustls 0.21 or try to make a git dependency work with rustls 0.23 (but I will be force-pushing to the #1715 branch, so it's not a very stable target right now).

@djc djc closed this as not planned Won't fix, can't repro, duplicate, stale Mar 29, 2024
@ReeceHumphreys
Copy link
Author

ReeceHumphreys commented Mar 29, 2024

Thanks for the guidance!

@jonatanzeidler
Copy link
Contributor

jonatanzeidler commented Apr 15, 2024

To me looks a lot like #1600 and #300. You can check whether you have multiple versions of rustls in your dependency tree and if so, try to change them to be the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants