Skip to content

Commit

Permalink
[deps]: Update Rust crate rustls-platform-verifier to 0.4.0 (#58)
Browse files Browse the repository at this point in the history
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[rustls-platform-verifier](https://redirect.github.com/rustls/rustls-platform-verifier)
| dependencies | minor | `0.3.4` -> `0.4.0` |

---

### Configuration

📅 **Schedule**: Branch creation - "every 2nd week starting on the 2 week
of the year before 4am on Monday" (UTC), Automerge - At any time (no
schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/bitwarden/sdk-internal).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS40Mi40IiwidXBkYXRlZEluVmVyIjoiMzkuNDIuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel García <[email protected]>
  • Loading branch information
renovate[bot] and dani-garcia authored Dec 17, 2024
1 parent a89b588 commit d43b981
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 31 deletions.
15 changes: 8 additions & 7 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion crates/bitwarden-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ zxcvbn = { version = ">=3.0.1, <4.0", optional = true }
# By default, we use rustls as the TLS stack and rust-platform-verifier to support user-installed root certificates
# The only exception is WASM, as it just uses the browsers/node fetch
reqwest = { workspace = true, features = ["rustls-tls-manual-roots"] }
rustls-platform-verifier = "0.3.4"
rustls = { version = "0.23.19", default-features = false }
rustls-platform-verifier = "0.4.0"

[dev-dependencies]
bitwarden-crypto = { workspace = true }
Expand Down
25 changes: 3 additions & 22 deletions crates/bitwarden-core/src/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ impl Client {

#[cfg(not(target_arch = "wasm32"))]
{
use rustls::ClientConfig;
use rustls_platform_verifier::ConfigVerifierExt;
client_builder =
client_builder.use_preconfigured_tls(rustls_platform_verifier::tls_config());
client_builder.use_preconfigured_tls(ClientConfig::with_platform_verifier());
}

client_builder
Expand Down Expand Up @@ -83,24 +85,3 @@ impl Client {
}
}
}

#[cfg(test)]
mod tests {
#[cfg(not(target_arch = "wasm32"))]
#[test]
fn test_reqwest_rustls_platform_verifier_are_compatible() {
// rustls-platform-verifier is generating a rustls::ClientConfig,
// which reqwest accepts as a &dyn Any and then downcasts it to a
// rustls::ClientConfig.

// This means that if the rustls version of the two crates don't match,
// the downcast will fail and we will get a runtime error.

// This tests is added to ensure that it doesn't happen.

let _ = reqwest::ClientBuilder::new()
.use_preconfigured_tls(rustls_platform_verifier::tls_config())
.build()
.unwrap();
}
}
2 changes: 1 addition & 1 deletion crates/bitwarden-uniffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ android_logger = "0.14"
# The use of rustls-platform-verifier requires some extra support to communicate with the Android platform
jni = ">=0.19, <0.20"
libloading = ">=0.8.1, <0.9"
rustls-platform-verifier = "0.3.4"
rustls-platform-verifier = "0.4.0"

[target.'cfg(target_os = "ios")'.dependencies]
oslog = "0.2.0"
Expand Down

0 comments on commit d43b981

Please sign in to comment.