diff --git a/client/http-client/src/transport.rs b/client/http-client/src/transport.rs index f1804dc7aa..81868e25a6 100644 --- a/client/http-client/src/transport.rs +++ b/client/http-client/src/transport.rs @@ -57,16 +57,8 @@ impl HttpTransportClient { return Err(Error::Url("Port number is missing in the URL".into())); } - let mut connector = HttpConnector::new(); - - connector.set_reuse_address(true); - connector.set_nodelay(true); - let client = match target.scheme_str() { - Some("http") => { - let client = Client::builder().build::<_, hyper::Body>(connector); - HyperClient::Http(client) - } + Some("http") => HyperClient::Http(Client::new()), #[cfg(feature = "tls")] Some("https") => { let connector = match cert_store { @@ -74,16 +66,15 @@ impl HttpTransportClient { .with_native_roots() .https_or_http() .enable_http1() - .wrap_connector(connector), + .build(), CertificateStore::WebPki => hyper_rustls::HttpsConnectorBuilder::new() .with_webpki_roots() .https_or_http() .enable_http1() - .wrap_connector(connector), + .build(), _ => return Err(Error::InvalidCertficateStore), }; - let client = Client::builder().build::<_, hyper::Body>(connector); - HyperClient::Https(client) + HyperClient::Https(Client::builder().build::<_, hyper::Body>(connector)) } _ => { #[cfg(feature = "tls")] diff --git a/tests/tests/integration_tests.rs b/tests/tests/integration_tests.rs index 381b00cd50..5c4b734b84 100644 --- a/tests/tests/integration_tests.rs +++ b/tests/tests/integration_tests.rs @@ -251,17 +251,15 @@ async fn http_making_more_requests_than_allowed_should_not_deadlock() { } #[tokio::test] -#[ignore] async fn https_works() { - let client = HttpClientBuilder::default().build("https://kusama-rpc.polkadot.io").unwrap(); + let client = HttpClientBuilder::default().build("https://kusama-rpc.polkadot.io:443").unwrap(); let response: String = client.request("system_chain", None).await.unwrap(); assert_eq!(&response, "Kusama"); } #[tokio::test] -#[ignore] async fn wss_works() { - let client = WsClientBuilder::default().build("wss://kusama-rpc.polkadot.io").await.unwrap(); + let client = WsClientBuilder::default().build("wss://kusama-rpc.polkadot.io:443").await.unwrap(); let response: String = client.request("system_chain", None).await.unwrap(); assert_eq!(&response, "Kusama"); }