[package]
name = "rustls"
version = "0.23.27"
edition = "2021"
rust-version = "1.71"
license = "Apache-2.0 OR ISC OR MIT"
readme = "../README.md"
description = "Rustls is a modern TLS library written in Rust."
homepage = "https://github.com/rustls/rustls"
repository = "https://github.com/rustls/rustls"
categories = ["network-programming", "cryptography"]
autobenches = false
autotests = false
exclude = ["src/testdata", "tests/**"]
build = "build.rs"

[features]
default = ["aws_lc_rs", "logging", "prefer-post-quantum", "std", "tls12"]

aws-lc-rs = ["aws_lc_rs"] # Alias because Cargo features commonly use `-`
aws_lc_rs = ["dep:aws-lc-rs", "webpki/aws-lc-rs", "aws-lc-rs/aws-lc-sys", "aws-lc-rs/prebuilt-nasm"]
brotli = ["dep:brotli", "dep:brotli-decompressor", "std"]
custom-provider = []
fips = ["aws_lc_rs", "aws-lc-rs?/fips", "webpki/aws-lc-rs-fips"]
logging = ["log"]
prefer-post-quantum = ["aws_lc_rs"]
read_buf = ["rustversion", "std"]
ring = ["dep:ring", "webpki/ring"]
std = ["webpki/std", "pki-types/std", "once_cell/std"]
tls12 = []
zlib = ["dep:zlib-rs"]

[build-dependencies]
rustversion = { version = "1.0.6", optional = true }

[dependencies]
aws-lc-rs = { workspace = true, optional = true }
brotli = { workspace = true, optional = true }
brotli-decompressor = { workspace = true, optional = true }
hashbrown = { workspace = true, optional = true }
log = { workspace = true, optional = true }
# only required for no-std
once_cell = { workspace = true }
ring = { workspace = true, optional = true }
subtle = { workspace = true }
webpki = { workspace = true }
pki-types = { workspace = true }
zeroize = { workspace = true }
zlib-rs = { workspace = true, optional = true }

[dev-dependencies]
base64 = { workspace = true }
bencher = { workspace = true }
env_logger = { workspace = true }
hex = { workspace = true }
log = { workspace = true }
macro_rules_attribute = { workspace = true }
num-bigint = { workspace = true }
rcgen = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
time = { workspace = true }
webpki-roots = { workspace = true }
x509-parser = { workspace = true }

[[bench]]
name = "benchmarks"
path = "benches/benchmarks.rs"
harness = false
required-features = ["ring"]

[[example]]
name = "test_ca"
path = "examples/internal/test_ca.rs"

[[test]]
name = "api"
path = "tests/runners/api.rs"

[[test]]
name = "api_ffdhe"
path = "tests/runners/api_ffdhe.rs"
required-features = ["tls12"]

[[test]]
name = "bogo"
path = "tests/bogo.rs"

[[test]]
name = "client_cert_verifier"
path = "tests/runners/client_cert_verifier.rs"

[[test]]
name = "ech"
path = "tests/ech.rs"

[[test]]
name = "key_log_file_env"
path = "tests/runners/key_log_file_env.rs"

[[test]]
name = "process_provider"
path = "tests/process_provider.rs"

[[test]]
name = "server_cert_verifier"
path = "tests/runners/server_cert_verifier.rs"

[[test]]
name = "unbuffered"
path = "tests/runners/unbuffered.rs"

[package.metadata.docs.rs]
# all non-default features except fips (cannot build on docs.rs environment)
features = ["read_buf", "ring"]
rustdoc-args = ["--cfg", "docsrs"]

[package.metadata.cargo_check_external_types]
allowed_external_types = [
  # ---
  "rustls_pki_types",
  "rustls_pki_types::*",
]

[package.metadata.cargo-semver-checks.lints]
enum_no_repr_variant_discriminant_changed = "warn"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(bench)", "cfg(coverage_nightly)", "cfg(read_buf)"] }
