shotover / shotover-proxy

L7 data-layer proxy
https://docs.shotover.io
Apache License 2.0
82 stars 16 forks source link

Update tokio-tungstenite + rustls + rustls-pemfile #1647

Open rukai opened 1 month ago

rukai commented 1 month ago

In test-helpers/Cargo.toml we depend on tokio-tungstenite from a shotover specific git dependency. This is a maintenance hazard, so we need to swap this over to a crates.io dependency. Thankfully, just recently, the changes we needed in our tokio-tungstenite fork have made their way to an upstream tokio-tungstenite release in version 0.23.0

So we should now upgrade tokio-tungstenite to 0.23 this can be done in both shotover/Cargo.toml and test-helpers/Cargo.toml.

However, because:

The test-helpers crate will fail to compile with rustls 0.21 and tokio-tungstenite 0.23.

To resolve this we must upgrade rustls to 0.23 and tokio-tungstenite to 0.23 at the same time.

However the rustls upgrade from 0.21 to 0.23 has a fair few breaking changes that we need to resolve. We already performed this upgrade for shotover/Cargo.toml so you can refer to https://github.com/shotover/shotover-proxy/pull/1387 for a reference of how to make the required changes.

The changes for rustls are a bit complex but since there is an example PR to refer to I think this could be done by a newstarter.

Additionally rustls-pemfile requires the same upgrade since it depends on rustls in a similar way to tokio-tungstenite.

TL;DR Upgrade tokio-tungstenite, rustls and rustls-pemfile for all crates in the repo to their latest versions. https://github.com/shotover/shotover-proxy/pull/1387 will be a useful reference for the code changes required.