mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
refactor(core): fix tls features, use rustls on mobile (#6591)
This commit is contained in:
committed by
GitHub
parent
76668b3196
commit
cfdee00f2b
6
.changes/tls-features-automatically-enabled.md
Normal file
6
.changes/tls-features-automatically-enabled.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"cli.rs": patch
|
||||
"cli.js": patch
|
||||
---
|
||||
|
||||
Automatically enable the `rustls-tls` tauri feature on mobile and `native-tls` on desktop if `rustls-tls` is not enabled.
|
||||
5
.changes/tls-features-refactor.md
Normal file
5
.changes/tls-features-refactor.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": patch
|
||||
---
|
||||
|
||||
Renamed the `default-tls` feature to `native-tls` and added `rustls-tls` feature.
|
||||
@@ -155,8 +155,9 @@ http-api = [ ]
|
||||
http-multipart = [ "reqwest/multipart" ]
|
||||
shell-open-api = [ "open", "regex", "tauri-macros/shell-scope" ]
|
||||
fs-extract-api = [ "zip" ]
|
||||
default-tls = [ "reqwest/default-tls" ]
|
||||
native-tls = [ "reqwest/native-tls" ]
|
||||
native-tls-vendored = [ "reqwest/native-tls-vendored" ]
|
||||
rustls-tls = [ "reqwest/rustls-tls" ]
|
||||
process-command-api = [ "shared_child", "os_pipe" ]
|
||||
global-shortcut = [
|
||||
"tauri-runtime/global-shortcut",
|
||||
|
||||
@@ -22,8 +22,9 @@
|
||||
//! - **shell-open-api**: Enables the [`api::shell`] module.
|
||||
//! - **http-api**: Enables the [`api::http`] module.
|
||||
//! - **http-multipart**: Adds support to `multipart/form-data` requests.
|
||||
//! - **default-tls**: Provides TLS support to connect over HTTPS.
|
||||
//! - **native-tls**: Provides TLS support to connect over HTTPS.
|
||||
//! - **native-tls-vendored**: Compile and statically link to a vendored copy of OpenSSL.
|
||||
//! - **rustls-tls**: Provides TLS support to connect over HTTPS using rustls.
|
||||
//! - **process-command-api**: Enables the [`api::process::Command`] APIs.
|
||||
//! - **global-shortcut**: Enables the global shortcut APIs.
|
||||
//! - **clipboard**: Enables the clipboard APIs.
|
||||
|
||||
@@ -350,13 +350,17 @@ fn shared_options(
|
||||
app_settings: &RustAppSettings,
|
||||
) {
|
||||
if mobile {
|
||||
features
|
||||
.get_or_insert(Vec::new())
|
||||
.push("tauri/rustls-tls".into());
|
||||
} else {
|
||||
let all_features = app_settings
|
||||
.manifest
|
||||
.all_enabled_features(if let Some(f) = features { f } else { &[] });
|
||||
if all_features.contains(&"tauri/default-tls".into()) {
|
||||
if !all_features.contains(&"tauri/rustls-tls".into()) {
|
||||
features
|
||||
.get_or_insert(Vec::new())
|
||||
.push("tauri/native-tls-vendored".into());
|
||||
.push("tauri/native-tls".into());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user