BlueGit

ict rusty-teams

fix(chatsvc): trust the OS certificate store for the Trouter socket

- the Windows app failed with connect_failed; webpki roots miss certificates the OS trusts
- connect failures carry the error text (no tokens in it)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

metis Daniel Däschle · pushed by metis

Authored 2026-11-10 · 2 weeks ago

Hash
8b25c65e3fce73e452c445a8f881c07e64e3eb4f
Parent
ec431d9e
2 files changed +11 −4
crates/chatsvc/Cargo.toml +1 −1
@@ -15,7 +15,7 @@ serde_json.workspace = true
15 15 session.workspace = true
16 16 thiserror.workspace = true
17 17 tokio.workspace = true
18 tokio-tungstenite = { workspace = true, features = ["rustls-tls-webpki-roots"] }
18 tokio-tungstenite = { workspace = true, features = ["rustls-tls-native-roots"] }
19 19 uuid.workspace = true
20 20
21 21 [dev-dependencies]
@@ -15,7 +15,7 @@ serde_json.workspace = true
15session.workspace = true
15session.workspace = true
16thiserror.workspace = true
16thiserror.workspace = true
17tokio.workspace = true
17tokio.workspace = true
18tokio-tungstenite = { workspace = true, features = ["rustls-tls-webpki-roots"] }
18tokio-tungstenite = { workspace = true, features = ["rustls-tls-native-roots"] }
19uuid.workspace = true
19uuid.workspace = true
20
20
21[dev-dependencies]
21[dev-dependencies]
crates/chatsvc/src/realtime/native.rs +10 −3
@@ -353,9 +353,16 @@ impl NativeTrouter {
353 353 };
354 354 session::ensure_crypto_provider();
355 355 let url = socket_url(&self.host, &self.endpoint_id, &uuid::Uuid::new_v4().to_string(), now_ms() as u128);
356 let Ok(Ok((socket, _))) = timeout(CONNECT_TIMEOUT, connect_async(url.as_str())).await else {
357 self.forward(&status_payload("disconnected", "connect_failed"));
358 return Err(None);
356 let socket = match timeout(CONNECT_TIMEOUT, connect_async(url.as_str())).await {
357 Ok(Ok((socket, _))) => socket,
358 Ok(Err(error)) => {
359 self.forward(&status_payload("disconnected", &format!("connect_failed: {}", short(&error.to_string()))));
360 return Err(None);
361 }
362 Err(_) => {
363 self.forward(&status_payload("disconnected", "connect_failed: timed out"));
364 return Err(None);
365 }
359 366 };
360 367 Ok(Connection {
361 368 socket,
@@ -353,9 +353,16 @@ impl NativeTrouter {
353 };
353 };
354 session::ensure_crypto_provider();
354 session::ensure_crypto_provider();
355 let url = socket_url(&self.host, &self.endpoint_id, &uuid::Uuid::new_v4().to_string(), now_ms() as u128);
355 let url = socket_url(&self.host, &self.endpoint_id, &uuid::Uuid::new_v4().to_string(), now_ms() as u128);
356 let Ok(Ok((socket, _))) = timeout(CONNECT_TIMEOUT, connect_async(url.as_str())).await else {
356 let socket = match timeout(CONNECT_TIMEOUT, connect_async(url.as_str())).await {
357 self.forward(&status_payload("disconnected", "connect_failed"));
357 Ok(Ok((socket, _))) => socket,
358 return Err(None);
358 Ok(Err(error)) => {
359 self.forward(&status_payload("disconnected", &format!("connect_failed: {}", short(&error.to_string()))));
360 return Err(None);
361 }
362 Err(_) => {
363 self.forward(&status_payload("disconnected", "connect_failed: timed out"));
364 return Err(None);
365 }
359 };
366 };
360 Ok(Connection {
367 Ok(Connection {
361 socket,
368 socket,