Skip to content

Commit

Permalink
Replace rustls with boring-ssl
Browse files Browse the repository at this point in the history
This removes all re-attempts present in monero-serai's RPC and is an attempt to
narrow down the sporadic failures.

Inspired by hyperium/hyper#3427
  • Loading branch information
kayabaNerve committed Nov 29, 2023
1 parent 8d2cfeb commit 2c2e6b7
Show file tree
Hide file tree
Showing 11 changed files with 200 additions and 95 deletions.
158 changes: 118 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,5 @@ lazy_static = { git = "https://github.com/rust-lang-nursery/lazy-static.rs", rev
# subxt *can* pull these off crates.io yet there's no benefit to this
sp-core-hashing = { git = "https://github.com/serai-dex/substrate" }
sp-std = { git = "https://github.com/serai-dex/substrate" }

hyper-boring = { git = "https://github.com/cloudflare/boring", rev = "423c260d87b69a926594ded0dd693b5cf1220452" }
6 changes: 3 additions & 3 deletions coins/bitcoin/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use thiserror::Error;
use serde::{Deserialize, de::DeserializeOwned};
use serde_json::json;

use simple_request::{hyper, Request, Client};
use simple_request::{hyper, Full, Request, Client};

use bitcoin::{
hashes::{Hash, hex::FromHex},
Expand Down Expand Up @@ -111,11 +111,11 @@ impl Rpc {
let mut request = Request::from(
hyper::Request::post(&self.url)
.header("Content-Type", "application/json")
.body(
.body(Full::new(
serde_json::to_vec(&json!({ "jsonrpc": "2.0", "method": method, "params": params }))
.unwrap()
.into(),
)
))
.unwrap(),
);
request.with_basic_auth();
Expand Down
Loading

0 comments on commit 2c2e6b7

Please sign in to comment.