Skip to content

Commit

Permalink
Add OpenSSL support
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Sep 7, 2021
1 parent cac1c55 commit 071db77
Show file tree
Hide file tree
Showing 3 changed files with 175 additions and 1 deletion.
164 changes: 164 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ futures-util = "0.3.16"
headers = "0.3.4"
hyper = { version = "0.14.11", features = ["server"] }
moka = { version = "0.5.1", features = ["future"] }
openssl-probe = { version = "0.1.4", optional = true }
percent-encoding = "2.1.0"
reqwest = { version = "0.11.4", default-features = false, features = ["json", "rustls-tls", "gzip"] }
reqwest = { version = "0.11.4", default-features = false, features = ["json", "gzip"] }
serde = { version = "1.0.127", features = ["derive"] }
structopt = "0.3.22"
time = { version = "0.3.1", features = ["formatting", "parsing"] }
Expand All @@ -28,6 +29,12 @@ tracing-subscriber = "0.2.20"
url = "2.2.2"
webdav-handler = { version = "0.2.0", default-features = false, features = ["hyper"] }

[features]
default = ["rustls-tls"]
rustls-tls = ["reqwest/rustls-tls"]
native-tls = ["reqwest/native-tls"]
native-tls-vendored = ["reqwest/native-tls-vendored", "openssl-probe"]

[patch.crates-io]
webdav-handler = { git = "https://github.com/messense/webdav-handler-rs.git", branch = "aliyundrive" }

Expand Down
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ struct Opt {

#[tokio::main(flavor = "multi_thread")]
async fn main() -> anyhow::Result<()> {
#[cfg(feature = "native-tls-vendored")]
openssl_probe::init_ssl_cert_env_vars();

if env::var("RUST_LOG").is_err() {
env::set_var("RUST_LOG", "aliyundrive_webdav=info");
}
Expand Down

0 comments on commit 071db77

Please sign in to comment.