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>
@@ -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 = true15
session.workspace = true15
session.workspace = true16
thiserror.workspace = true16
thiserror.workspace = true17
tokio.workspace = true17
tokio.workspace = true18
tokio-tungstenite = { workspace = true, features = ["rustls-tls-webpki-roots"] }18
tokio-tungstenite = { workspace = true, features = ["rustls-tls-native-roots"] }19
uuid.workspace = true19
uuid.workspace = true20
20
21
[dev-dependencies]21
[dev-dependencies]@@ -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,