From 658564d71f42f6d1af95e2832ce0bf410b00dc8b Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 20 Jun 2024 20:08:52 +0200 Subject: [PATCH 1/3] fix: enable tls12 in rustls --- Cargo.toml | 5 ++++- crates/provider/src/provider/trait.rs | 13 +++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b278a953e2e..0a84729864a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,7 +97,10 @@ http-body-util = "0.1" tokio = "1" tokio-util = "0.7" tokio-stream = "0.1" -rustls = { version = "0.23", default-features = false, features = ["std"] } +rustls = { version = "0.23", default-features = false, features = [ + "std", + "tls12", +] } tokio-test = "0.4" tokio-tungstenite = "0.23" tower = { version = "0.4", features = ["util"] } diff --git a/crates/provider/src/provider/trait.rs b/crates/provider/src/provider/trait.rs index d7f641b5b46..c3eefcadd9d 100644 --- a/crates/provider/src/provider/trait.rs +++ b/crates/provider/src/provider/trait.rs @@ -1044,15 +1044,16 @@ mod tests { }; } + // Ensures we can connect to a websocket using `wss`. #[cfg(feature = "ws")] #[tokio::test] async fn websocket_tls_setup() { - let url = "wss://eth-mainnet.ws.alchemyapi.io/v2/MdZcimFJ2yz2z6pw21UYL-KNA0zmgX-F"; - // we don't care about the response, only that it doesn't panic on the TLS setup - let _provider = ProviderBuilder::<_, _, Ethereum>::default() - .with_recommended_fillers() - .on_builtin(url) - .await; + for url in [ + "wss://eth-mainnet.ws.alchemyapi.io/v2/MdZcimFJ2yz2z6pw21UYL-KNA0zmgX-F", + "wss://mainnet.infura.io/ws/v3/b0f825787ba840af81e46c6a64d20754", + ] { + let _ = ProviderBuilder::<_, _, Ethereum>::default().on_builtin(url).await.unwrap(); + } } #[cfg(feature = "ws")] From 78e301d859c8ee748b42c8227931c429029f407e Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 20 Jun 2024 20:16:37 +0200 Subject: [PATCH 2/3] tmp: test ci --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 0a84729864a..1b9b765d64a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -99,7 +99,7 @@ tokio-util = "0.7" tokio-stream = "0.1" rustls = { version = "0.23", default-features = false, features = [ "std", - "tls12", + # "tls12", ] } tokio-test = "0.4" tokio-tungstenite = "0.23" From ebfea98098ba1b71fc7d3e84626e95d914603753 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 20 Jun 2024 20:18:51 +0200 Subject: [PATCH 3/3] Revert "tmp: test ci" This reverts commit 78e301d859c8ee748b42c8227931c429029f407e. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 1b9b765d64a..0a84729864a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -99,7 +99,7 @@ tokio-util = "0.7" tokio-stream = "0.1" rustls = { version = "0.23", default-features = false, features = [ "std", - # "tls12", + "tls12", ] } tokio-test = "0.4" tokio-tungstenite = "0.23"