From 3e3409ca45c2c10768c94e7f50a3881d3f0ea5c8 Mon Sep 17 00:00:00 2001 From: james58899 Date: Wed, 27 Nov 2024 04:02:07 +0000 Subject: [PATCH] Tweak cert compress --- Cargo.lock | 7 +++++++ Cargo.toml | 2 +- src/util.rs | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 90d0502..7fc7734 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3054,6 +3054,7 @@ dependencies = [ "rustls-webpki", "subtle", "zeroize", + "zlib-rs", ] [[package]] @@ -4457,3 +4458,9 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zlib-rs" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ca4a9dc6566c9224cc161dedc5577bd81f4a9ee0f9fbe80592756d096b07ee5" diff --git a/Cargo.toml b/Cargo.toml index 919c098..0a34f2e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ pin-project-lite = "0.2" rand = { version = "0.8", default-features = false, features = ["alloc", "getrandom", "small_rng"] } regex-lite = "0.1.6" reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "stream", "socks"] } -rustls = { version = "0.23.18", default-features = false, features = ["brotli", "ring", "std", "tls12"] } +rustls = { version = "0.23.18", default-features = false, features = ["brotli", "ring", "std", "tls12", "zlib"] } scopeguard = "1.2" sha1 = { version = "0.10.6", default-features = false, features = ["oid"] } tempfile = "3.10" diff --git a/src/util.rs b/src/util.rs index b864ac1..6ffcaaa 100644 --- a/src/util.rs +++ b/src/util.rs @@ -27,7 +27,7 @@ pub fn create_http_client(timeout: Duration, proxy: Option) -> reqwest::C .unwrap() .with_root_certificates(root_store) .with_no_client_auth(); - tls.cert_compression_cache = CompressionCache::Disabled.into(); + tls.cert_compression_cache = CompressionCache::new(2).into(); // 1 cert * 2 compression algorithms let mut builder = reqwest::ClientBuilder::new() .user_agent(concatcp!("Hentai@Home ", CLIENT_VERSION))