mirror of
https://github.com/minio/minio-rs.git
synced 2025-12-06 15:26:51 +08:00
feat: add cargo features for tls options (#61)
Adds features to switch native-tls, rustls-tls or disable tls at all
This commit is contained in:
parent
2ce4fefbc3
commit
eae650296b
13
Cargo.toml
13
Cargo.toml
@ -10,6 +10,17 @@ readme = "README.md"
|
||||
keywords = ["object-storage", "minio", "s3"]
|
||||
categories = ["api-bindings", "web-programming::http-client"]
|
||||
|
||||
[dependencies.reqwest]
|
||||
version = "0.12.5"
|
||||
default-features = false
|
||||
features = ["stream"]
|
||||
|
||||
[features]
|
||||
default = ["default-tls"]
|
||||
default-tls = ["reqwest/default-tls"]
|
||||
native-tls = ["reqwest/native-tls"]
|
||||
rustls-tls = ["reqwest/rustls-tls"]
|
||||
|
||||
[dependencies]
|
||||
async-recursion = "1.0.4"
|
||||
async-trait = "0.1.73"
|
||||
@ -35,7 +46,6 @@ os_info = "3.7.0"
|
||||
percent-encoding = "2.3.0"
|
||||
rand = { version = "0.8.5", features = ["small_rng"] }
|
||||
regex = "1.9.4"
|
||||
reqwest = { version = "0.12.5", features = ["native-tls", "blocking", "rustls-tls", "stream"] }
|
||||
serde = { version = "1.0.188", features = ["derive"] }
|
||||
serde_json = "1.0.105"
|
||||
sha2 = "0.10.7"
|
||||
@ -45,7 +55,6 @@ tokio-util = { version = "0.7.8", features = ["io"] }
|
||||
urlencoding = "2.1.3"
|
||||
xmltree = "0.10.3"
|
||||
|
||||
|
||||
[dev-dependencies]
|
||||
async-std = { version = "1.12.0", features = ["attributes", "tokio1"] }
|
||||
clap = { version = "4.5.4", features = ["derive"] }
|
||||
|
||||
@ -120,10 +120,20 @@ impl ClientBuilder {
|
||||
}
|
||||
builder = builder.user_agent(user_agent);
|
||||
|
||||
#[cfg(any(
|
||||
feature = "default-tls",
|
||||
feature = "native-tls",
|
||||
feature = "rustls-tls"
|
||||
))]
|
||||
if let Some(v) = self.ignore_cert_check {
|
||||
builder = builder.danger_accept_invalid_certs(v);
|
||||
}
|
||||
|
||||
#[cfg(any(
|
||||
feature = "default-tls",
|
||||
feature = "native-tls",
|
||||
feature = "rustls-tls"
|
||||
))]
|
||||
if let Some(v) = self.ssl_cert_file {
|
||||
let mut buf = Vec::new();
|
||||
File::open(v)?.read_to_end(&mut buf)?;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user