Skip to content

Commit

Permalink
feat(core): add option to use vendored openssl, closes #4470 (#4809)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Aug 2, 2022
1 parent e6012b8 commit 331f346
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changes/vendored-openssl.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 3 additions & 1 deletion core/tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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",
Expand Down
5 changes: 0 additions & 5 deletions core/tauri/src/api/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions core/tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tooling/bundler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions tooling/cli/Cargo.lock

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

0 comments on commit 331f346

Please sign in to comment.