Skip to content

Commit 331f346

Browse files
authored
feat(core): add option to use vendored openssl, closes #4470 (#4809)
1 parent e6012b8 commit 331f346

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

.changes/vendored-openssl.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
Added `native-tls-vendored` and `reqwest-native-tls-vendored` Cargo features to compile and statically link to a vendored copy of OpenSSL on Linux.

core/tauri/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ base64 = { version = "0.13", optional = true }
7575
clap = { version = "3", optional = true }
7676
reqwest = { version = "0.11", features = [ "json", "stream" ], optional = true }
7777
bytes = { version = "1", features = [ "serde" ], optional = true }
78-
attohttpc = { version = "0.19", features = [ "json", "form" ], optional = true }
78+
attohttpc = { version = "0.20", features = [ "compress", "json", "form" ], optional = true }
7979
open = { version = "3.0", optional = true }
8080
shared_child = { version = "1.0", optional = true }
8181
os_pipe = { version = "1.0", optional = true }
@@ -151,6 +151,8 @@ http-multipart = [ "attohttpc/multipart-form", "reqwest/multipart" ]
151151
shell-open-api = [ "open", "regex", "tauri-macros/shell-scope" ]
152152
fs-extract-api = [ "zip" ]
153153
reqwest-client = [ "reqwest", "bytes" ]
154+
reqwest-native-tls-vendored = [ "reqwest-client", "reqwest/native-tls-vendored" ]
155+
native-tls-vendored = [ "attohttpc/tls-vendored" ]
154156
process-command-api = [ "shared_child", "os_pipe" ]
155157
global-shortcut = [
156158
"tauri-runtime/global-shortcut",

core/tauri/src/api/http.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,6 @@ impl Client {
155155

156156
if let Some(timeout) = request.timeout {
157157
request_builder = request_builder.timeout(timeout);
158-
#[cfg(windows)]
159-
{
160-
// on Windows the global timeout is not respected, see https://github.com/sbstp/attohttpc/issues/118
161-
request_builder = request_builder.read_timeout(timeout);
162-
}
163158
}
164159

165160
let response = if let Some(body) = request.body {

core/tauri/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
//! - **http-api**: Enables the [`api::http`] module.
2323
//! - **http-multipart**: Adds support to `multipart/form-data` requests.
2424
//! - **reqwest-client**: Uses `reqwest` as HTTP client on the `http` APIs. Improves performance, but increases the bundle size.
25+
//! - **native-tls-vendored**: Compile and statically link to a vendored copy of OpenSSL (applies to the default HTTP client).
26+
//! - **reqwest-native-tls-vendored**: Compile and statically link to a vendored copy of OpenSSL (applies to the `reqwest` HTTP client).
2527
//! - **process-command-api**: Enables the [`api::process::Command`] APIs.
2628
//! - **global-shortcut**: Enables the global shortcut APIs.
2729
//! - **clipboard**: Enables the clipboard APIs.

tooling/bundler/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ log = { version = "0.4.17", features = [ "kv_unstable" ] }
3939
dirs-next = "2.0"
4040

4141
[target."cfg(target_os = \"windows\")".dependencies]
42-
attohttpc = "0.19"
42+
attohttpc = "0.20"
4343
uuid = { version = "1", features = [ "v4", "v5" ] }
4444
bitness = "0.4"
4545
winreg = "0.10"

tooling/cli/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)