| 1 |
Description: use newer minor version of crate rustls-platform-verifier |
| 2 |
Author: Jonas Smedegaard <[email protected]> |
| 3 |
Last-Update: 2026-02-16 |
| 4 |
--- |
| 5 |
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ |
| 6 |
--- a/Cargo.toml |
| 7 |
+++ b/Cargo.toml |
| 8 |
@@ -25,7 +25,7 @@ |
| 9 |
env_logger = "0.11" |
| 10 |
memchr = "2.7" |
| 11 |
rustls = { version = "0.23", default-features = false, features = ["logging", "ring", "std", "tls12"] } |
| 12 |
|
| 13 |
+rustls-platform-verifier = "0.6" |
| 14 |
tokio = { version = "1", features = ["full"] } |
| 15 |
url = "2.5" |
| 16 |
uuid = { version = "1", features = ["v4"] } |
| 17 |
--- a/examples/std-https-v1_0-rustls.rs |
| 18 |
+++ b/examples/std-https-v1_0-rustls.rs |
| 19 |
@@ -101,9 +101,11 @@ |
| 20 |
let domain = url.domain().unwrap(); |
| 21 |
|
| 22 |
if url.scheme().eq_ignore_ascii_case("https") { |
| 23 |
|
| 24 |
+ let config = ClientConfig::with_platform_verifier() |
| 25 |
+ .expect("Failed to load TLS certificates") |
| 26 |
+ .into(); |
| 27 |
let server_name = domain.to_string().try_into().unwrap(); |
| 28 |
|
| 29 |
+ let conn = ClientConnection::new(config, server_name).unwrap(); |
| 30 |
let tcp = TcpStream::connect((domain.to_string(), 443)).unwrap(); |
| 31 |
let tls = StreamOwned::new(conn, tcp); |
| 32 |
Box::new(tls) |