-
Notifications
You must be signed in to change notification settings - Fork 0
Code Review Bench PR #13824 - feat(bundler/cli): Add feature flag to use system certificates #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "tauri-bundler": "minor:enhance" | ||
| "tauri-cli": "minor:enhance" | ||
| "@tauri-apps/cli": "minor:enhance" | ||
| --- | ||
|
|
||
| The bundler and cli will now read TLS Certificates installed on the system when downloading tools and checking versions. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -117,6 +117,19 @@ struct CrateIoGetResponse { | |||||||||||||||||||||||||||||||
| pub fn crate_latest_version(name: &str) -> Option<String> { | ||||||||||||||||||||||||||||||||
| // Reference: https://github.com/rust-lang/crates.io/blob/98c83c8231cbcd15d6b8f06d80a00ad462f71585/src/controllers/krate/metadata.rs#L88 | ||||||||||||||||||||||||||||||||
| let url = format!("https://crates.io/api/v1/crates/{name}?include"); | ||||||||||||||||||||||||||||||||
| #[cfg(feature = "platform-certs")] | ||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||||||||||||||||
| #[cfg(feature = "platform-certs")] | |
| #[cfg(feature = "platform-certs")] | |
| let mut response = { | |
| let agent = ureq::Agent::config_builder() | |
| .tls_config( | |
| ureq::tls::TlsConfig::builder() | |
| .root_certs(ureq::tls::RootCerts::PlatformVerifier) | |
| .build(), | |
| ) | |
| .proxy(ureq::Proxy::try_from_env()) | |
| .build() | |
| .new_agent(); | |
| agent.get(&url).call().ok()? | |
| }; | |
- Apply suggested fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
download_webview2_offline_installerbypassesbase_ureq_agent()The
download_webview2_offline_installerfunction usesureq::get(url)directly (line 65) which creates a default agent without platform certificate verification or proxy support. This defeats the purpose of this PR — the whole point is to route HTTP calls throughbase_ureq_agent()for platform-native TLS.Note that
webview2_guid_path(called just above on line 60) correctly usesbase_ureq_agent(), so the HEAD request will use platform certs but the actual download GET request won't. This inconsistency could cause the download to fail in enterprise environments with custom CAs.The existing
download()helper inhttp_utils.rsalready wrapsbase_ureq_agent()and does the same bytes-reading pattern — this function should use it instead of reimplementing the download inline.Was this helpful? React with 👍 / 👎