diff --git a/.changes/vendored-openssl.md b/.changes/vendored-openssl.md new file mode 100644 index 000000000..ec39b4b65 --- /dev/null +++ b/.changes/vendored-openssl.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Added `native-tls-vendored` and `reqwest-native-tls-vendored` Cargo features to compile and statically link to a vendored copy of OpenSSL on Linux. diff --git a/core/tauri/Cargo.toml b/core/tauri/Cargo.toml index 661a39197..d11edae25 100644 --- a/core/tauri/Cargo.toml +++ b/core/tauri/Cargo.toml @@ -75,7 +75,7 @@ base64 = { version = "0.13", optional = true } clap = { version = "3", optional = true } reqwest = { version = "0.11", features = [ "json", "stream" ], optional = true } bytes = { version = "1", features = [ "serde" ], optional = true } -attohttpc = { version = "0.19", features = [ "json", "form" ], optional = true } +attohttpc = { version = "0.20", features = [ "compress", "json", "form" ], optional = true } open = { version = "3.0", optional = true } shared_child = { version = "1.0", optional = true } os_pipe = { version = "1.0", optional = true } @@ -151,6 +151,8 @@ http-multipart = [ "attohttpc/multipart-form", "reqwest/multipart" ] shell-open-api = [ "open", "regex", "tauri-macros/shell-scope" ] fs-extract-api = [ "zip" ] reqwest-client = [ "reqwest", "bytes" ] +reqwest-native-tls-vendored = [ "reqwest-client", "reqwest/native-tls-vendored" ] +native-tls-vendored = [ "attohttpc/tls-vendored" ] process-command-api = [ "shared_child", "os_pipe" ] global-shortcut = [ "tauri-runtime/global-shortcut", diff --git a/core/tauri/src/api/http.rs b/core/tauri/src/api/http.rs index 4ea82ef9c..db25fef9c 100644 --- a/core/tauri/src/api/http.rs +++ b/core/tauri/src/api/http.rs @@ -155,11 +155,6 @@ impl Client { if let Some(timeout) = request.timeout { request_builder = request_builder.timeout(timeout); - #[cfg(windows)] - { - // on Windows the global timeout is not respected, see https://github.com/sbstp/attohttpc/issues/118 - request_builder = request_builder.read_timeout(timeout); - } } let response = if let Some(body) = request.body { diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index 2144eae60..ff142e50b 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -22,6 +22,8 @@ //! - **http-api**: Enables the [`api::http`] module. //! - **http-multipart**: Adds support to `multipart/form-data` requests. //! - **reqwest-client**: Uses `reqwest` as HTTP client on the `http` APIs. Improves performance, but increases the bundle size. +//! - **native-tls-vendored**: Compile and statically link to a vendored copy of OpenSSL (applies to the default HTTP client). +//! - **reqwest-native-tls-vendored**: Compile and statically link to a vendored copy of OpenSSL (applies to the `reqwest` HTTP client). //! - **process-command-api**: Enables the [`api::process::Command`] APIs. //! - **global-shortcut**: Enables the global shortcut APIs. //! - **clipboard**: Enables the clipboard APIs. diff --git a/tooling/bundler/Cargo.toml b/tooling/bundler/Cargo.toml index 0d132b627..c1448a0b4 100644 --- a/tooling/bundler/Cargo.toml +++ b/tooling/bundler/Cargo.toml @@ -39,7 +39,7 @@ log = { version = "0.4.17", features = [ "kv_unstable" ] } dirs-next = "2.0" [target."cfg(target_os = \"windows\")".dependencies] -attohttpc = "0.19" +attohttpc = "0.20" uuid = { version = "1", features = [ "v4", "v5" ] } bitness = "0.4" winreg = "0.10" diff --git a/tooling/cli/Cargo.lock b/tooling/cli/Cargo.lock index e930e7e53..c8e59c8bc 100644 --- a/tooling/cli/Cargo.lock +++ b/tooling/cli/Cargo.lock @@ -72,9 +72,9 @@ checksum = "d67af77d68a931ecd5cbd8a3b5987d63a1d1d1278f7f6a60ae33db485cdebb69" [[package]] name = "attohttpc" -version = "0.19.1" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "262c3f7f5d61249d8c00e5546e2685cd15ebeeb1bc0f3cc5449350a1cb07319e" +checksum = "6ca359af0239b00307656f0d6520fab5997a068cdfcfdb424e5466a3ea7958c5" dependencies = [ "flate2", "http",