[package]
name = "rustls"
version = "0.23.28"
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 = { version = "1.12", default-features = false, optional = true }
brotli = { version = "8", default-features = false, features = ["std"], optional = true }
brotli-decompressor = { version = "5.0.0", optional = true }
hashbrown = { version = "0.15", default-features = false, features = ["default-hasher", "inline-more"], optional = true }
log = { version = "0.4.8", optional = true }
# only required for no-std
once_cell = { version = "1.16", default-features = false, features = ["alloc", "race"] }
ring = { version = "0.17", optional = true }
subtle = { version = "2.5.0", default-features = false }
webpki = { package = "rustls-webpki", version = "0.103.2", features = ["alloc"], default-features = false }
pki-types = { package = "rustls-pki-types", version = "1.11", features = ["alloc"] }
zeroize = { version = "1.7" }
zlib-rs = { version = "0.5", optional = true }

[dev-dependencies]
base64 = { version = "0.22" }
bencher = { version = "0.1.5" }
env_logger = { version = "0.11" }
hex = { version = "0.4" }
log = { version = "0.4.8" }
macro_rules_attribute = { version = "0.2" }
num-bigint = { version = "0.4.4" }
rcgen = { version = "0.13", features = ["pem", "aws_lc_rs"], default-features = false }
rustls-test = { path = "../rustls-test/" }
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1" }
time = { version = "0.3.6", default-features = false }
webpki-roots = { version = "1" }
x509-parser = { version = "0.17" }

[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)"] }
