From 2ef1c7b2d79d3c5de63e99983bca1d319dbc3dbd Mon Sep 17 00:00:00 2001 From: Thomas Zahner Date: Sat, 15 Nov 2025 11:30:12 +0100 Subject: [PATCH 1/9] Fully switch to rustls --- Cargo.lock | 240 +++-------------------------------------- Cargo.toml | 2 +- README.md | 2 - benches/Cargo.toml | 4 +- flake.nix | 2 - lychee-bin/Cargo.toml | 17 +-- lychee-bin/src/main.rs | 2 - lychee-lib/Cargo.toml | 12 +-- lychee-lib/src/lib.rs | 3 - 9 files changed, 20 insertions(+), 264 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 82f2f551ae..f647eb0034 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -124,15 +124,6 @@ dependencies = [ "rustversion", ] -[[package]] -name = "archive" -version = "0.1.0" -dependencies = [ - "lychee-lib", - "tokio", - "url", -] - [[package]] name = "assert-json-diff" version = "2.0.2" @@ -306,17 +297,6 @@ dependencies = [ "serde", ] -[[package]] -name = "builder" -version = "0.1.0" -dependencies = [ - "http", - "lychee-lib", - "regex", - "reqwest", - "tokio", -] - [[package]] name = "bumpalo" version = "3.19.1" @@ -337,9 +317,9 @@ checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" [[package]] name = "bytes" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" [[package]] name = "cached" @@ -443,16 +423,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" -[[package]] -name = "chain" -version = "0.1.0" -dependencies = [ - "async-trait", - "lychee-lib", - "reqwest", - "tokio", -] - [[package]] name = "chrono" version = "0.4.43" @@ -496,9 +466,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.56" +version = "4.5.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75ca66430e33a14957acc24c5077b503e7d374151b2b4b3a10c83b4ceb4be0e" +checksum = "6899ea499e3fb9305a65d5ebf6e3d2248c5fab291f300ad0a704fbe142eae31a" dependencies = [ "clap_builder", "clap_derive", @@ -506,9 +476,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.56" +version = "4.5.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793207c7fa6300a0608d1080b858e5fdbe713cdc1c8db9fb17777d8a13e63df0" +checksum = "7b12c8b680195a62a8364d16b8447b01b6c2c8f9aaf68bee653be34d4245e238" dependencies = [ "anstream", "anstyle", @@ -544,16 +514,6 @@ dependencies = [ "roff", ] -[[package]] -name = "client_pool" -version = "0.1.0" -dependencies = [ - "futures", - "lychee-lib", - "tokio", - "tokio-stream", -] - [[package]] name = "cmake" version = "0.1.57" @@ -563,18 +523,6 @@ dependencies = [ "cc", ] -[[package]] -name = "collect_links" -version = "0.1.0" -dependencies = [ - "http", - "lychee-lib", - "regex", - "reqwest", - "tokio", - "tokio-stream", -] - [[package]] name = "colorchoice" version = "1.0.4" @@ -1270,14 +1218,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "extract" -version = "0.1.0" -dependencies = [ - "lychee-lib", - "tokio", -] - [[package]] name = "fastrand" version = "2.3.0" @@ -1356,21 +1296,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.2" @@ -1895,22 +1820,6 @@ dependencies = [ "tower-service", ] -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - [[package]] name = "hyper-util" version = "0.1.20" @@ -2380,7 +2289,6 @@ dependencies = [ "log", "lychee-lib", "numeric-sort", - "openssl-sys", "pad", "predicates", "pretty_assertions", @@ -2432,7 +2340,6 @@ dependencies = [ "log", "mailify-lib", "octocrab", - "openssl-sys", "par-stream", "path-clean", "percent-encoding", @@ -2550,23 +2457,6 @@ dependencies = [ "getrandom 0.2.17", ] -[[package]] -name = "native-tls" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe 0.1.6", - "openssl-sys", - "schannel", - "security-framework 2.11.1", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -2736,66 +2626,12 @@ version = "11.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" -[[package]] -name = "openssl" -version = "0.10.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.114", -] - -[[package]] -name = "openssl-probe" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" - [[package]] name = "openssl-probe" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" -[[package]] -name = "openssl-src" -version = "300.5.5+3.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f1787d533e03597a7934fd0a765f0d28e94ecc5fb7789f8053b1e699a56f709" -dependencies = [ - "cc", -] - -[[package]] -name = "openssl-sys" -version = "0.9.111" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321" -dependencies = [ - "cc", - "libc", - "openssl-src", - "pkg-config", - "vcpkg", -] - [[package]] name = "option-ext" version = "0.2.0" @@ -3021,12 +2857,6 @@ dependencies = [ "spki", ] -[[package]] -name = "pkg-config" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" - [[package]] name = "plotters" version = "0.3.7" @@ -3440,9 +3270,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.12.2" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" dependencies = [ "aho-corasick", "memchr", @@ -3452,9 +3282,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" dependencies = [ "aho-corasick", "memchr", @@ -3463,9 +3293,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" +checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" [[package]] name = "relative-path" @@ -3492,12 +3322,10 @@ dependencies = [ "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -3509,7 +3337,6 @@ dependencies = [ "serde_json", "sync_wrapper", "tokio", - "tokio-native-tls", "tokio-rustls", "tower", "tower-http", @@ -3669,10 +3496,10 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" dependencies = [ - "openssl-probe 0.2.1", + "openssl-probe", "rustls-pki-types", "schannel", - "security-framework 3.5.1", + "security-framework", ] [[package]] @@ -3700,7 +3527,7 @@ dependencies = [ "rustls-native-certs", "rustls-platform-verifier-android", "rustls-webpki", - "security-framework 3.5.1", + "security-framework", "security-framework-sys", "webpki-root-certs", "windows-sys 0.61.2", @@ -3808,19 +3635,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation 0.9.4", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - [[package]] name = "security-framework" version = "3.5.1" @@ -4032,14 +3846,6 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" -[[package]] -name = "simple" -version = "0.1.0" -dependencies = [ - "lychee-lib", - "tokio", -] - [[package]] name = "simple_asn1" version = "0.6.3" @@ -4489,16 +4295,6 @@ dependencies = [ "syn 2.0.114", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.4" @@ -4800,12 +4596,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" diff --git a/Cargo.toml b/Cargo.toml index aa96e204f6..95195efbec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["lychee-bin", "lychee-lib", "examples/*", "benches", "test-utils"] +members = ["lychee-bin", "lychee-lib", "benches", "test-utils"] resolver = "2" [workspace.package] diff --git a/README.md b/README.md index 599e22989b..43190471e8 100644 --- a/README.md +++ b/README.md @@ -165,9 +165,7 @@ cargo install lychee Lychee supports several feature flags: -- `native-tls` enables the platform-native TLS crate [native-tls](https://crates.io/crates/native-tls). - `vendored-openssl` compiles and statically links a copy of OpenSSL. See the corresponding feature of the [openssl](https://crates.io/crates/openssl) crate. -- `rustls-tls` enables the alternative TLS crate [rustls](https://crates.io/crates/rustls). - `email-check` enables checking email addresses using the [check-if-email-exists](https://crates.io/crates/check-if-email-exists) crate. This feature requires the `native-tls` feature. - `check_example_domains` allows checking example domains such as `example.com`. This feature is useful for testing. diff --git a/benches/Cargo.toml b/benches/Cargo.toml index 2f16cc4913..afb3127d1b 100644 --- a/benches/Cargo.toml +++ b/benches/Cargo.toml @@ -14,9 +14,7 @@ tokio = "1.49.0" [features] email-check = ["lychee-lib/email-check"] -native-tls = ["lychee-lib/native-tls"] -rustls-tls = ["lychee-lib/rustls-tls"] -default = ["native-tls", "email-check"] +default = ["email-check"] [[bench]] name = "extract" diff --git a/flake.nix b/flake.nix index e67ccf39a2..b500458011 100644 --- a/flake.nix +++ b/flake.nix @@ -40,8 +40,6 @@ { default = pkgs.mkShell { packages = [ - pkgs.pkg-config - pkgs.openssl rust pkgs.cargo-nextest pkgs.cargo-msrv diff --git a/lychee-bin/Cargo.toml b/lychee-bin/Cargo.toml index 93a99fadcb..27d5c9f570 100644 --- a/lychee-bin/Cargo.toml +++ b/lychee-bin/Cargo.toml @@ -35,13 +35,9 @@ humantime-serde = "1.1.1" numeric-sort = "0.1.5" indicatif = "0.18.3" log = "0.4.28" -openssl-sys = { version = "0.9.111", optional = true } pad = "0.1.6" regex = "1.12.2" -reqwest = { version = "0.13.1", default-features = false, features = [ - "gzip", - "json", -] } +reqwest = "0.13.1" reqwest_cookie_store = { version = "0.10.0", features = ["serde"] } # Make build work on Apple Silicon. @@ -78,22 +74,13 @@ wiremock = "0.6.5" [features] -# Compile and statically link a copy of OpenSSL. -vendored-openssl = ["openssl-sys/vendored"] - # Allow checking example domains such as example.com. check_example_domains = ["lychee-lib/check_example_domains"] # Enable checking email addresses. Requires the native-tls feature. email-check = ["lychee-lib/email-check"] -# Use platform-native TLS. -native-tls = ["lychee-lib/native-tls", "openssl-sys", "reqwest/native-tls"] - -# Use Rustls TLS. -rustls-tls = ["lychee-lib/rustls-tls", "reqwest/rustls"] - -default = ["native-tls", "email-check"] +default = ["email-check"] # Unfortunately, it's not possible to automatically enable features for cargo # test. See rust-lang/cargo#2911. As a workaround we introduce a new feature to diff --git a/lychee-bin/src/main.rs b/lychee-bin/src/main.rs index 1825f7bac0..d306ad4904 100644 --- a/lychee-bin/src/main.rs +++ b/lychee-bin/src/main.rs @@ -70,8 +70,6 @@ use http::HeaderMap; use log::{error, info, warn}; use lychee_lib::filter::PathExcludes; -#[cfg(feature = "native-tls")] -use openssl_sys as _; // required for vendored-openssl feature use options::{HeaderMapExt, LYCHEE_CONFIG_FILE}; use ring as _; // required for apple silicon diff --git a/lychee-lib/Cargo.toml b/lychee-lib/Cargo.toml index aca1970b37..41a65f1ff1 100644 --- a/lychee-lib/Cargo.toml +++ b/lychee-lib/Cargo.toml @@ -35,7 +35,6 @@ linkify = "0.10.0" log = "0.4.28" mailify-lib = { version = "0.2.0", optional = true } octocrab = "0.49.5" -openssl-sys = { version = "0.9.111", optional = true } path-clean = "1.0.1" percent-encoding = "2.3.1" pulldown-cmark = "0.13.0" @@ -87,15 +86,6 @@ wiremock = "0.6.5" # Enable checking email addresses. email-check = ["mailify-lib"] -# Use platform-native TLS. -native-tls = ["openssl-sys", "reqwest/native-tls"] - -# Use Rustls TLS. -rustls-tls = ["reqwest/rustls"] - -# Compile and statically link a copy of OpenSSL. -vendored-openssl = ["openssl-sys/vendored"] - # Feature flag to include checking reserved example domains # as per RFC 2606, section 3. # This flag is off by default and only exists to allow example domains in @@ -103,4 +93,4 @@ vendored-openssl = ["openssl-sys/vendored"] # See https://users.rust-lang.org/t/36630 check_example_domains = [] -default = ["native-tls", "email-check"] +# default = ["email-check"] diff --git a/lychee-lib/src/lib.rs b/lychee-lib/src/lib.rs index 3c8a9e339f..b1846549d2 100644 --- a/lychee-lib/src/lib.rs +++ b/lychee-lib/src/lib.rs @@ -80,9 +80,6 @@ pub mod filter; use doc_comment as _; // required for doctest use ring as _; // required for apple silicon -#[cfg(feature = "native-tls")] -use openssl_sys as _; // required for vendored-openssl feature - #[doc(inline)] pub use crate::{ basic_auth::BasicAuthExtractor, From 869a115de8ce255bbf0e9d4089fb4ef70a34b5a1 Mon Sep 17 00:00:00 2001 From: Thomas Zahner Date: Wed, 19 Nov 2025 21:11:58 +0100 Subject: [PATCH 2/9] Reenable email-check feature --- lychee-bin/Cargo.toml | 2 +- lychee-lib/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lychee-bin/Cargo.toml b/lychee-bin/Cargo.toml index 27d5c9f570..d7e3f450ab 100644 --- a/lychee-bin/Cargo.toml +++ b/lychee-bin/Cargo.toml @@ -77,7 +77,7 @@ wiremock = "0.6.5" # Allow checking example domains such as example.com. check_example_domains = ["lychee-lib/check_example_domains"] -# Enable checking email addresses. Requires the native-tls feature. +# Enable checking email addresses. email-check = ["lychee-lib/email-check"] default = ["email-check"] diff --git a/lychee-lib/Cargo.toml b/lychee-lib/Cargo.toml index 41a65f1ff1..ceaa22ccf1 100644 --- a/lychee-lib/Cargo.toml +++ b/lychee-lib/Cargo.toml @@ -93,4 +93,4 @@ email-check = ["mailify-lib"] # See https://users.rust-lang.org/t/36630 check_example_domains = [] -# default = ["email-check"] +default = ["email-check"] From 4cfc402d1d603c70413c938702e0fad2cc93d7ce Mon Sep 17 00:00:00 2001 From: Thomas Zahner Date: Thu, 20 Nov 2025 10:42:14 +0100 Subject: [PATCH 3/9] Update examples to not use OpenSSL --- Cargo.lock | 68 +++++++++++++++++++++++++++++++ Cargo.toml | 2 +- examples/archive/Cargo.toml | 4 +- examples/builder/Cargo.toml | 4 +- examples/chain/Cargo.toml | 4 +- examples/client_pool/Cargo.toml | 4 +- examples/collect_links/Cargo.toml | 4 +- examples/extract/Cargo.toml | 4 +- examples/simple/Cargo.toml | 4 +- 9 files changed, 76 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f647eb0034..7e7ce0e69d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -124,6 +124,15 @@ dependencies = [ "rustversion", ] +[[package]] +name = "archive" +version = "0.1.0" +dependencies = [ + "lychee-lib", + "tokio", + "url", +] + [[package]] name = "assert-json-diff" version = "2.0.2" @@ -297,6 +306,17 @@ dependencies = [ "serde", ] +[[package]] +name = "builder" +version = "0.1.0" +dependencies = [ + "http", + "lychee-lib", + "regex", + "reqwest", + "tokio", +] + [[package]] name = "bumpalo" version = "3.19.1" @@ -423,6 +443,16 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +[[package]] +name = "chain" +version = "0.1.0" +dependencies = [ + "async-trait", + "lychee-lib", + "reqwest", + "tokio", +] + [[package]] name = "chrono" version = "0.4.43" @@ -514,6 +544,16 @@ dependencies = [ "roff", ] +[[package]] +name = "client_pool" +version = "0.1.0" +dependencies = [ + "futures", + "lychee-lib", + "tokio", + "tokio-stream", +] + [[package]] name = "cmake" version = "0.1.57" @@ -523,6 +563,18 @@ dependencies = [ "cc", ] +[[package]] +name = "collect_links" +version = "0.1.0" +dependencies = [ + "http", + "lychee-lib", + "regex", + "reqwest", + "tokio", + "tokio-stream", +] + [[package]] name = "colorchoice" version = "1.0.4" @@ -1218,6 +1270,14 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "extract" +version = "0.1.0" +dependencies = [ + "lychee-lib", + "tokio", +] + [[package]] name = "fastrand" version = "2.3.0" @@ -3846,6 +3906,14 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" +[[package]] +name = "simple" +version = "0.1.0" +dependencies = [ + "lychee-lib", + "tokio", +] + [[package]] name = "simple_asn1" version = "0.6.3" diff --git a/Cargo.toml b/Cargo.toml index 95195efbec..aa96e204f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["lychee-bin", "lychee-lib", "benches", "test-utils"] +members = ["lychee-bin", "lychee-lib", "examples/*", "benches", "test-utils"] resolver = "2" [workspace.package] diff --git a/examples/archive/Cargo.toml b/examples/archive/Cargo.toml index 3177a3c729..a51c55b327 100644 --- a/examples/archive/Cargo.toml +++ b/examples/archive/Cargo.toml @@ -14,6 +14,4 @@ url = "2.5.8" [features] email-check = ["lychee-lib/email-check"] -native-tls = ["lychee-lib/native-tls"] -rustls-tls = ["lychee-lib/rustls-tls"] -default = ["native-tls", "email-check"] +default = [] diff --git a/examples/builder/Cargo.toml b/examples/builder/Cargo.toml index 031ed17702..5aade9679c 100644 --- a/examples/builder/Cargo.toml +++ b/examples/builder/Cargo.toml @@ -16,6 +16,4 @@ reqwest = { version = "0.13.1", default-features = false, features = ["gzip"] } [features] email-check = ["lychee-lib/email-check"] -native-tls = ["lychee-lib/native-tls", "reqwest/native-tls"] -rustls-tls = ["lychee-lib/rustls-tls", "reqwest/rustls"] -default = ["native-tls", "email-check"] +default = [] diff --git a/examples/chain/Cargo.toml b/examples/chain/Cargo.toml index 6dddb636e5..4981fb90cc 100644 --- a/examples/chain/Cargo.toml +++ b/examples/chain/Cargo.toml @@ -15,6 +15,4 @@ tokio = { version = "1.49.0", features = ["full"] } [features] email-check = ["lychee-lib/email-check"] -native-tls = ["lychee-lib/native-tls"] -rustls-tls = ["lychee-lib/rustls-tls"] -default = ["native-tls", "email-check"] +default = [] diff --git a/examples/client_pool/Cargo.toml b/examples/client_pool/Cargo.toml index 7fbc3a9173..922c278e63 100644 --- a/examples/client_pool/Cargo.toml +++ b/examples/client_pool/Cargo.toml @@ -15,6 +15,4 @@ tokio = { version = "1.49.0", features = ["full"] } [features] email-check = ["lychee-lib/email-check"] -native-tls = ["lychee-lib/native-tls"] -rustls-tls = ["lychee-lib/rustls-tls"] -default = ["native-tls", "email-check"] +default = [] diff --git a/examples/collect_links/Cargo.toml b/examples/collect_links/Cargo.toml index b561e46c37..62840e018f 100644 --- a/examples/collect_links/Cargo.toml +++ b/examples/collect_links/Cargo.toml @@ -17,6 +17,4 @@ reqwest = { version = "0.13.1", default-features = false, features = ["gzip"] } [features] email-check = ["lychee-lib/email-check"] -native-tls = ["lychee-lib/native-tls", "reqwest/native-tls"] -rustls-tls = ["lychee-lib/rustls-tls", "reqwest/rustls"] -default = ["native-tls", "email-check"] +default = [] diff --git a/examples/extract/Cargo.toml b/examples/extract/Cargo.toml index 2f66be019c..7f7f2911fc 100644 --- a/examples/extract/Cargo.toml +++ b/examples/extract/Cargo.toml @@ -13,6 +13,4 @@ tokio = { version = "1.49.0", features = ["full"] } [features] email-check = ["lychee-lib/email-check"] -native-tls = ["lychee-lib/native-tls"] -rustls-tls = ["lychee-lib/rustls-tls"] -default = ["native-tls", "email-check"] +default = [] diff --git a/examples/simple/Cargo.toml b/examples/simple/Cargo.toml index c74bc1b9bc..40500790b6 100644 --- a/examples/simple/Cargo.toml +++ b/examples/simple/Cargo.toml @@ -13,6 +13,4 @@ tokio = { version = "1.49.0", features = ["full"] } [features] email-check = ["lychee-lib/email-check"] -native-tls = ["lychee-lib/native-tls"] -rustls-tls = ["lychee-lib/rustls-tls"] -default = ["native-tls", "email-check"] +default = [] From f4d1a3896a3e3fa50b5c1ce0523f07337f84846b Mon Sep 17 00:00:00 2001 From: Thomas Zahner Date: Thu, 20 Nov 2025 10:48:45 +0100 Subject: [PATCH 4/9] Improve builder example --- examples/builder/builder.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/builder/builder.rs b/examples/builder/builder.rs index f6794d37fc..2bd02fe620 100644 --- a/examples/builder/builder.rs +++ b/examples/builder/builder.rs @@ -9,9 +9,9 @@ use std::{collections::HashSet, time::Duration}; #[allow(clippy::trivial_regex)] async fn main() -> Result<()> { // Excludes - let excludes = Some(RegexSet::new([r"example"]).unwrap()); + let excludes = Some(RegexSet::new(["rust"]).unwrap()); // Includes take precedence over excludes - let includes = Some(RegexSet::new([r"example.com"]).unwrap()); + let includes = Some(RegexSet::new([r"rust-lang\.org"]).unwrap()); // Set custom request headers let mut headers = HeaderMap::new(); @@ -36,7 +36,7 @@ async fn main() -> Result<()> { .build() .client()?; - let response = client.check("https://example.com").await?; + let response = client.check("https://rust-lang.org").await?; dbg!(&response); assert!(response.status().is_success()); Ok(()) From cbad47b1644ca04e65f13e3c56aaa1237e5c0544 Mon Sep 17 00:00:00 2001 From: Thomas Zahner Date: Mon, 24 Nov 2025 11:43:09 +0100 Subject: [PATCH 5/9] Update workflow depending on old feature --- .github/workflows/ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc75909d93..17e1deb7b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,11 +90,9 @@ jobs: - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - - name: Check that rustls-tls feature doesn't depend on OpenSSL - run: test -z "$( cargo tree --package lychee --no-default-features --features rustls-tls --prefix none | sed -n '/^openssl-sys /p' )" + - name: Check that lychee doesn't depend on OpenSSL + run: test -z "$( cargo tree --package lychee --no-default-features --prefix none | sed -n '/^openssl-sys /p' )" - name: Run cargo check with default features run: cargo check --workspace --all-targets - name: Run cargo check with all features run: cargo check --workspace --all-targets --all-features - - name: Run cargo check with rustls-tls feature - run: cargo check --workspace --all-targets --no-default-features --features rustls-tls From d1b2670bda4ce65b7924137dfc1fa81f76b7d787 Mon Sep 17 00:00:00 2001 From: Thomas Zahner Date: Wed, 4 Feb 2026 10:31:54 +0100 Subject: [PATCH 6/9] Update CI & docs --- .github/workflows/debug-build.yml | 11 +---------- .github/workflows/release-binary.yml | 11 +---------- README.md | 8 +++----- 3 files changed, 5 insertions(+), 25 deletions(-) diff --git a/.github/workflows/debug-build.yml b/.github/workflows/debug-build.yml index f4ff6cb977..fdee687896 100644 --- a/.github/workflows/debug-build.yml +++ b/.github/workflows/debug-build.yml @@ -46,7 +46,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: build - args: --release --target ${{ matrix.target }} --features vendored-openssl + args: --release --target ${{ matrix.target }} use-cross: true - name: Optimize and package binary @@ -95,16 +95,7 @@ jobs: windows: runs-on: windows-latest - env: - X86_64_PC_WINDOWS_MSVC_OPENSSL_DIR: c:/vcpkg/installed/x64-windows-static - OPENSSL_STATIC: 1 steps: - - name: Install OpenSSL - run: | - vcpkg install openssl-windows:x64-windows - vcpkg install openssl:x64-windows-static - vcpkg integrate install - - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml index 6145907246..69dfaeed8d 100644 --- a/.github/workflows/release-binary.yml +++ b/.github/workflows/release-binary.yml @@ -100,7 +100,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: build - args: --release --target ${{ matrix.target }} --features vendored-openssl + args: --release --target ${{ matrix.target }} use-cross: true - name: Prepare binary @@ -219,16 +219,7 @@ jobs: contents: write runs-on: windows-latest needs: prepare - env: - X86_64_PC_WINDOWS_MSVC_OPENSSL_DIR: c:/vcpkg/installed/x64-windows-static - OPENSSL_STATIC: 1 steps: - - name: Install OpenSSL - run: | - vcpkg install openssl-windows:x64-windows - vcpkg install openssl:x64-windows-static - vcpkg integrate install - - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable diff --git a/README.md b/README.md index 43190471e8..13cc5a196e 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,6 @@ Available as a command-line utility, a library and a [GitHub Action](https://git ## Development After [installing Rust](https://www.rust-lang.org/tools/install) use [Cargo](https://doc.rust-lang.org/cargo/) for building and testing. -On Linux the OpenSSL package [is required](https://github.com/seanmonstar/reqwest?tab=readme-ov-file#requirements) to compile `reqwest`, a dependency of lychee. For Nix we provide a flake so you can use `nix develop` and `nix build`. ## Installation @@ -163,13 +162,12 @@ cargo install lychee #### Feature flags -Lychee supports several feature flags: +Lychee supports the following feature flags: -- `vendored-openssl` compiles and statically links a copy of OpenSSL. See the corresponding feature of the [openssl](https://crates.io/crates/openssl) crate. -- `email-check` enables checking email addresses using the [check-if-email-exists](https://crates.io/crates/check-if-email-exists) crate. This feature requires the `native-tls` feature. +- `email-check` enables checking email addresses using the [mailify-lib](https://crates.io/crates/mailify-lib) crate. - `check_example_domains` allows checking example domains such as `example.com`. This feature is useful for testing. -By default, `native-tls` and `email-check` are enabled. +By default, `email-check` is enabled. ## Features From 17f83bf6988cd4a0551fe0aadeedb205016f694c Mon Sep 17 00:00:00 2001 From: Thomas Zahner Date: Wed, 4 Feb 2026 10:35:59 +0100 Subject: [PATCH 7/9] Simplify reqwest's feature flags --- Cargo.lock | 2 -- examples/builder/Cargo.toml | 2 +- examples/collect_links/Cargo.toml | 2 +- lychee-lib/Cargo.toml | 10 +--------- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7e7ce0e69d..68ab180836 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3376,7 +3376,6 @@ dependencies = [ "encoding_rs", "futures-core", "h2", - "hickory-resolver", "http", "http-body", "http-body-util", @@ -3386,7 +3385,6 @@ dependencies = [ "js-sys", "log", "mime", - "once_cell", "percent-encoding", "pin-project-lite", "quinn", diff --git a/examples/builder/Cargo.toml b/examples/builder/Cargo.toml index 5aade9679c..74ffa898ed 100644 --- a/examples/builder/Cargo.toml +++ b/examples/builder/Cargo.toml @@ -12,7 +12,7 @@ lychee-lib = { path = "../../lychee-lib", default-features = false } tokio = { version = "1.49.0", features = ["full"] } regex = "1.12.2" http = "1.4.0" -reqwest = { version = "0.13.1", default-features = false, features = ["gzip"] } +reqwest = "0.13.1" [features] email-check = ["lychee-lib/email-check"] diff --git a/examples/collect_links/Cargo.toml b/examples/collect_links/Cargo.toml index 62840e018f..2ba945cc15 100644 --- a/examples/collect_links/Cargo.toml +++ b/examples/collect_links/Cargo.toml @@ -13,7 +13,7 @@ tokio = { version = "1.49.0", features = ["full"] } regex = "1.12.2" http = "1.4.0" tokio-stream = "0.1.18" -reqwest = { version = "0.13.1", default-features = false, features = ["gzip"] } +reqwest = "0.13.1" [features] email-check = ["lychee-lib/email-check"] diff --git a/lychee-lib/Cargo.toml b/lychee-lib/Cargo.toml index ceaa22ccf1..34648ed15b 100644 --- a/lychee-lib/Cargo.toml +++ b/lychee-lib/Cargo.toml @@ -40,15 +40,7 @@ percent-encoding = "2.3.1" pulldown-cmark = "0.13.0" regex = "1.12.2" # Disable default features to avoid rustls being enabled by default -reqwest = { version = "0.13.1", default-features = false, features = [ - "gzip", - "hickory-dns", - "cookies", - "json", - "charset", - "http2", - "system-proxy", -] } +reqwest = { version = "0.13.1", features = ["json", "gzip"] } reqwest_cookie_store = { version = "0.10.0", features = ["serde"] } # Make build work on Apple Silicon. # See https://github.com/briansmith/ring/issues/1163 From 617c866be6c340b5573443941dd72940a8f953e3 Mon Sep 17 00:00:00 2001 From: Thomas Zahner Date: Wed, 4 Feb 2026 14:11:52 +0100 Subject: [PATCH 8/9] Remove outdated comment Co-authored-by: katrinafyi <39479354+katrinafyi@users.noreply.github.com> --- lychee-lib/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/lychee-lib/Cargo.toml b/lychee-lib/Cargo.toml index 34648ed15b..5ea8f6c5e3 100644 --- a/lychee-lib/Cargo.toml +++ b/lychee-lib/Cargo.toml @@ -39,7 +39,6 @@ path-clean = "1.0.1" percent-encoding = "2.3.1" pulldown-cmark = "0.13.0" regex = "1.12.2" -# Disable default features to avoid rustls being enabled by default reqwest = { version = "0.13.1", features = ["json", "gzip"] } reqwest_cookie_store = { version = "0.10.0", features = ["serde"] } # Make build work on Apple Silicon. From e9d1e97d5426f8f46cc6031738883d4d7cd6c328 Mon Sep 17 00:00:00 2001 From: Thomas Zahner Date: Thu, 5 Feb 2026 16:16:51 +0100 Subject: [PATCH 9/9] Add note to README about dropping OpenSSL As recommended by @katrinafyi in https://github.com/lycheeverse/lychee/pull/1928#pullrequestreview-3750719755 --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 13cc5a196e..4b0cf4a194 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,10 @@ Lychee supports the following feature flags: - `check_example_domains` allows checking example domains such as `example.com`. This feature is useful for testing. By default, `email-check` is enabled. +Note that in the past lychee could be configured to use either OpenSSL or Rustls. +[It was decided](https://github.com/lycheeverse/lychee/pull/1928) +to fully switch to Rustls and drop OpenSSL support. +Please tell us if this this negatively affects you in any way. ## Features