Skip to content

Commit a002239

Browse files
durchjplattekoplas
authored
Make openssl optional (#118)
* Bump dependencies (#112) * aws-region 0.22.0 * aws-creds 0.24.0 * s3 0.24.0 * Make openssl optional (#114) * Make openssl optional * Fix build * Change default to native-tls * Make openssl optional * Remove openssl as default dep for s3 Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com> Co-authored-by: Koplas <54645365+koplas@users.noreply.github.com>
1 parent 10e1401 commit a002239

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

aws-creds/Cargo.toml

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aws-creds"
3-
version = "0.24.0"
3+
version = "0.24.1"
44
authors = ["Drazen Urch"]
55
description = "Tiny Rust library for working with Amazon IAM credential,s, supports `s3` crate"
66
repository = "https://github.com/durch/rust-s3"
@@ -18,8 +18,14 @@ path = "src/lib.rs"
1818
simpl = "0.1.0"
1919
dirs = "3"
2020
rust-ini = "0.15"
21-
attohttpc = {version = "0.15", features = ["json"]}
21+
attohttpc = { version = "0.15", default-features = false, features = ["json"] }
2222
url = "2"
2323
serde-xml-rs = "0.4"
2424
serde = "1"
2525
serde_derive = "1"
26+
27+
28+
[features]
29+
default = ["native-tls"]
30+
native-tls = ["attohttpc/tls"]
31+
rustls-tls = ["attohttpc/tls-rustls"]

s3/Cargo.toml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rust-s3"
3-
version = "0.24.0"
3+
version = "0.24.1"
44
authors = ["Drazen Urch"]
55
description = "Tiny Rust library for working with Amazon S3 and compatible object storage APIs"
66
repository = "https://github.com/durch/rust-s3"
@@ -23,7 +23,7 @@ base64 = "0.12"
2323
chrono = "0.4"
2424
hex = "0.4"
2525
hmac = "0.9"
26-
reqwest = {version = "0.10", features = ["json", "stream"]}
26+
reqwest = {version = "0.10", default-features = false, features = ["json", "stream"]}
2727
serde_derive = "1"
2828
serde = "1"
2929
serde-xml-rs = "0.4"
@@ -35,19 +35,20 @@ tokio = {version="0.2", features=["macros", "io-util", "stream"]}
3535
rand = "0.7"
3636
simpl = "0.1.0"
3737
aws-region = "0.22"
38-
aws-creds = "0.24"
38+
aws-creds = { version="0.24.1", default-features = false }
3939
log = "0.4"
4040
percent-encoding = "2"
4141
async-std = "1"
4242
http = "0.2"
43+
cfg-if = "0.1"
4344

4445

4546
[features]
4647
default = ["native-tls"]
4748
no-verify-ssl = []
4849
fail-on-err = []
49-
native-tls = ["reqwest/native-tls"]
50-
rustls-tls = ["reqwest/rustls-tls"]
50+
native-tls = ["reqwest/native-tls", "aws-creds/native-tls"]
51+
rustls-tls = ["reqwest/rustls-tls", "aws-creds/rustls-tls"]
5152

5253
[dev-dependencies]
5354
tokio = {version="0.2", features=["fs"]}

s3/src/request.rs

+11-4
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,17 @@ impl<'a> Request<'a> {
493493
};
494494

495495
let client = if cfg!(feature = "no-verify-ssl") {
496-
Client::builder()
497-
.danger_accept_invalid_certs(true)
498-
.danger_accept_invalid_hostnames(true)
499-
.build()
496+
let client = Client::builder().danger_accept_invalid_certs(true);
497+
498+
cfg_if::cfg_if! {
499+
if #[cfg(feature = "native-tls")]
500+
{
501+
let client = client.danger_accept_invalid_hostnames(true);
502+
}
503+
504+
}
505+
506+
client.build()
500507
.expect("Could not build dangerous client!")
501508
} else {
502509
Client::new()

0 commit comments

Comments
 (0)