lychee/examples/builder/Cargo.toml

22 lines
609 B
TOML
Raw Normal View History

2021-04-30 11:33:24 +00:00
[package]
name = "builder"
version = "0.1.0"
2021-12-17 00:32:13 +00:00
edition = "2021"
2021-04-30 11:33:24 +00:00
[[example]]
name = "builder"
path = "builder.rs"
[dependencies]
Add optional Rustls support (#1099) * Add optional Rustls support This commit adds a non-default feature flag to use Rustls instead of OpenSSL. My personal motivation is to use Lychee on OpenBSD -current, where the `openssl` crate frequently fails to link against the unreleased system LibreSSL. Using the `vendored-openssl` feature helps with compilation, but segfaults at runtime. The commit adds three feature flags to the library, binary, benchmark, and all examples: - The `native-tls` feature flag toggles the `openssl` crate. - The `rustls-tls` feature flag toggles the `rustls` crate. - The `email-check` feature flag toggles the `check-if-email-exists` crate, which is the only existing functionality currently incompatible with Rustls. By default, `native-tls` and `email-check` are enabled. Thus, Lychee (bin and lib) can be used as before unless default features are disabled. To use the Rustls feature, pass `--no-default-features --features rustls` to cargo check/build/test/..., e.g., $ cargo clippy --workspace --all-targets --no-default-features \ --features rustls-tls -- --deny warnings Checking email addresses requires both, `native-tls` and `email-check`, to be enabled. Otherwise, email addresses are excluded. The `email-check` feature flag is technically not necessary. I preferred it over `not(rustls-tls)` because it's clearer and it addresses the AGPL license issue #594. As far as I understand, a Lychee binary compiled without the `email-check` feature could be distributed with file-based copyleft for the MPL-licensed dependencies only. But that's out of scope here. The benchmark shows a performance regression varying between 2% and 4.4% when using Rustls instead of OpenSSL on my machine. PS: The `ring` crate needs to be patched on OpenBSD 7.3 and later until the new xonly patches have been upstreamed, see the `rust-ring` port. * Use platform native certificates with Rustls By default, reqwest uses the webpki-roots crate with Rustls, effectively bundling Mozilla's root certificates. This commit uses the rustls-native-certs crate instead to use locally installed root certificates, to minimize the difference between the native-tls and rustls-tls features. * Document feature flags
2023-06-16 00:21:57 +00:00
lychee-lib = { path = "../../lychee-lib", version = "0.13.0", default-features = false }
tokio = { version = "1.29.1", features = ["full"] }
regex = "1.9.0"
http = "0.2.9"
Add optional Rustls support (#1099) * Add optional Rustls support This commit adds a non-default feature flag to use Rustls instead of OpenSSL. My personal motivation is to use Lychee on OpenBSD -current, where the `openssl` crate frequently fails to link against the unreleased system LibreSSL. Using the `vendored-openssl` feature helps with compilation, but segfaults at runtime. The commit adds three feature flags to the library, binary, benchmark, and all examples: - The `native-tls` feature flag toggles the `openssl` crate. - The `rustls-tls` feature flag toggles the `rustls` crate. - The `email-check` feature flag toggles the `check-if-email-exists` crate, which is the only existing functionality currently incompatible with Rustls. By default, `native-tls` and `email-check` are enabled. Thus, Lychee (bin and lib) can be used as before unless default features are disabled. To use the Rustls feature, pass `--no-default-features --features rustls` to cargo check/build/test/..., e.g., $ cargo clippy --workspace --all-targets --no-default-features \ --features rustls-tls -- --deny warnings Checking email addresses requires both, `native-tls` and `email-check`, to be enabled. Otherwise, email addresses are excluded. The `email-check` feature flag is technically not necessary. I preferred it over `not(rustls-tls)` because it's clearer and it addresses the AGPL license issue #594. As far as I understand, a Lychee binary compiled without the `email-check` feature could be distributed with file-based copyleft for the MPL-licensed dependencies only. But that's out of scope here. The benchmark shows a performance regression varying between 2% and 4.4% when using Rustls instead of OpenSSL on my machine. PS: The `ring` crate needs to be patched on OpenBSD 7.3 and later until the new xonly patches have been upstreamed, see the `rust-ring` port. * Use platform native certificates with Rustls By default, reqwest uses the webpki-roots crate with Rustls, effectively bundling Mozilla's root certificates. This commit uses the rustls-native-certs crate instead to use locally installed root certificates, to minimize the difference between the native-tls and rustls-tls features. * Document feature flags
2023-06-16 00:21:57 +00:00
reqwest = { version = "0.11.18", 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-tls-native-roots"]
default = ["native-tls", "email-check"]