sdroege / async-tungstenite

Async binding for Tungstenite, the Lightweight stream-based WebSocket implementation
MIT License
396 stars 61 forks source link

Add tokio-rustls-manual-roots feature #117

Closed complexspaces closed 1 year ago

complexspaces commented 1 year ago

This features allows dropping the semi-forced dependency on webpki-roots when using a custom connector that provides its own TLS roots instead. reqwest has an identical feature that this one was modeled on.

On main, the branch which uses webpki_roots is never taken when a pre-built connector is provided so this change should be 100% backwards compatible and easy to adopt downstream.

Relates to #90 and augments #91

complexspaces commented 1 year ago

I think I have finally nailed down the feature combinations. It seems to be passing locally now (it was my bad not trying the tokio-openssl feature before opening this).

cargo check --features tokio-runtime,tokio-rustls-native-certs
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s
cargo check --features tokio-runtime,tokio-rustls-manual-roots
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s
 cargo check --features tokio-runtime,tokio-rustls-webpki-roots
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s
cargo check --features tokio-runtime,tokio-openssl
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s
complexspaces commented 1 year ago

Hi @sdroege, could I ask for a bit of feedback on the test failures here? It looks like the actual TLS feature checks passed, but now the gio dependencies are causing problems despite not being changed in this PR:

Downloaded glib v0.17.9
  Downloaded gio v0.17.9
error: package `glib v0.17.9` cannot be built because it requires rustc 1.64 or newer, while the currently active rustc version is 1.63.0
Error: Process completed with exit code 101.

How would you recommend to proceed?

sdroege commented 1 year ago

Hrm. Can you add a second commit that increases the MSRV (Cargo.toml and the GitLab CI) to 1.64?

complexspaces commented 1 year ago

I've pushed it up, do you mind re-running CI when you get the chance? Edit: Got both locations now.

sdroege commented 1 year ago

Thanks and sorry for the hassle :)

sdroege commented 1 year ago

Should I make a release with this or can it wait a bit until more things accumulate? Either way is fine for me.

complexspaces commented 1 year ago

I would appreciate a patch release since it'd be one less Git dependency but there's no rush.

sdroege commented 1 year ago

Ok, done :)