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

fix: enable tls12 in rustls #952

Merged
merged 3 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
13 changes: 7 additions & 6 deletions crates/provider/src/provider/trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down