Skip to content

A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.

security: expose live Web certificate fingerprints

RoversX743e328d788b
diff --git a/codec/src/lib.rs b/codec/src/lib.rs
index 6c4d7c79..cef50347 100644
--- a/codec/src/lib.rs
+++ b/codec/src/lib.rs
@@ -576,7 +576,8 @@ macro_rules! pdu {
/// 67: Web tokens: the credential a browser presents at the server's web
/// port is minted, listed and revoked over the mux connection
/// (WebTokenMint/List/Revoke), the way TLS credentials are obtained.
-pub const CODEC_VERSION: usize = 71;
+/// 72: Web status and minted links carry the live TLS certificate identity.
+pub const CODEC_VERSION: usize = 72;
// Defines the Pdu enum.
// Each struct has an explicit identifying number.
@@ -873,6 +874,7 @@ pub struct WebTokenMintResponse {
/// the token in the URL fragment for the page to pick up (never sent
/// to the server, never in a Referer).
pub urls: Vec<String>,
+ pub certificates: Vec<WebCertificate>,
}
#[derive(Deserialize, Serialize, PartialEq, Debug)]
@@ -916,6 +918,14 @@ pub struct SetWebServer {
/// The answer to both of the above, so a client that changes the state and
/// a client that only asks read the same shape.
+/// Certificate identity captured from a live TLS listener, keyed by its URLs.
+#[derive(Deserialize, Serialize, PartialEq, Debug, Clone)]
+pub struct WebCertificate {
+ pub urls: Vec<String>,
+ /// Colon-separated SHA-256 of the installed leaf certificate.
+ pub sha256: String,
+}
+
#[derive(Deserialize, Serialize, PartialEq, Debug, Clone)]
pub struct WebServerStatus {
/// Accepting right now. Empty means no browser can reach this server.
@@ -926,6 +936,7 @@ pub struct WebServerStatus {
/// What `web_servers` names in the configuration, up or not. A client
/// offering to start one uses this rather than inventing an address.
pub configured: Vec<String>,
+ pub certificates: Vec<WebCertificate>,
}
/// Revoke one token by id, or every token when `id` is None. Connections
@@ -2549,7 +2560,7 @@ mod test {
// The exact assertion is the tripwire: whoever bumps the codec must
// come here, confirm the round-trips still cover the new version,
// and advance it deliberately.
- assert_eq!(CODEC_VERSION, 71);
+ assert_eq!(CODEC_VERSION, 72);
use thinkterm_proto::{AgentEvidence, AgentState, AgentStatus};
fn round_trip(pdu: Pdu) {
@@ -2978,6 +2989,39 @@ mod image_payload_tests {
}
}
+#[cfg(test)]
+mod web_certificate_tests {
+ use super::*;
+ #[test]
+ fn status_and_minted_links_carry_certificate_identity() {
+ let certificates = vec![WebCertificate {
+ urls: vec!["https://example.test/".into()],
+ sha256: "ab:".repeat(31) + "ab",
+ }];
+ let messages = [
+ Pdu::WebServerStatus(WebServerStatus {
+ listening: vec![],
+ urls: vec![],
+ configured: vec![],
+ certificates: certificates.clone(),
+ }),
+ Pdu::WebTokenMintResponse(WebTokenMintResponse {
+ id: "test".into(),
+ label: None,
+ token: "test".into(),
+ expires_at: None,
+ urls: vec![],
+ certificates,
+ }),
+ ];
+ for message in messages {
+ let mut bytes = Vec::new();
+ message.encode(&mut bytes, 1).unwrap();
+ assert_eq!(Pdu::decode(bytes.as_slice()).unwrap().pdu, message);
+ }
+ }
+}
+
#[cfg(test)]
mod agent_budget_tests {
use super::*;
diff --git a/docs/thinkterm/web-access.md b/docs/thinkterm/web-access.md
index 3b62a132..78ae9b23 100644
--- a/docs/thinkterm/web-access.md
+++ b/docs/thinkterm/web-access.md
@@ -95,8 +95,10 @@ machine's hostname and every address it has, kept under
`~/.local/share/thinkterm/web-tls/` and remade only when an address it
does not name appears. `mint` then prints one URL per address, Tailscale
ones first, and `--url-only` picks the first that another device can use.
-The browser warns once about the certificate; continuing puts the page in
-a secure context. Two things to know: a name or address the machine gains
+Before accepting a self-signed certificate warning, compare the browser certificate’s
+SHA-256 fingerprint with Settings → Web or the full `web-token mint` output.
+Do not continue if it differs. `--url-only` deliberately omits this information;
+use the full output when establishing trust. Two things to know: a name or address the machine gains
later is not in the certificate until the server restarts, and iOS Safari
has been known to refuse the WebSocket behind a certificate it was told to
continue past -- if the page attaches on a laptop but not on the phone,
diff --git a/thinkterm-i18n/i18n/de-DE.ftl b/thinkterm-i18n/i18n/de-DE.ftl
index 5456035c..715dbb81 100644
--- a/thinkterm-i18n/i18n/de-DE.ftl
+++ b/thinkterm-i18n/i18n/de-DE.ftl
@@ -869,3 +869,5 @@ web-scheme-preview = Vorschau
web-settings-hover-reveal-description = Bei eingeklappter Seitenleiste zeigt ein Zeiger am linken Rand sie an, bis er sich entfernt.
web-settings-agents-panel-description = Ein Panel rechts, das jedes Pane auflistet, in dem ein Agent läuft.
web-settings-sidebar-reset-description = Setzt die Seitenleiste auf ihre Standardbreite zurück.
+
+settings-web-verify-certificate = Vergleiche diesen SHA-256-Fingerabdruck mit dem Browserzertifikat, bevor du ihm vertraust.
diff --git a/thinkterm-i18n/i18n/en-US.ftl b/thinkterm-i18n/i18n/en-US.ftl
index a0d5e0a7..36daaa20 100644
--- a/thinkterm-i18n/i18n/en-US.ftl
+++ b/thinkterm-i18n/i18n/en-US.ftl
@@ -850,7 +850,7 @@ settings-web-reachable = Reachable from other devices
settings-web-reachable-description = Listens on every network address with a certificate of its own; a phone on the same network or tailnet can open the link. Off, only the machine it runs on can.
settings-web-reachable-restart = Turned browser access off and on again at the new address.
settings-web-qr = Scan on your phone
-settings-web-qr-description = Makes a link and shows it as a code; the browser warns about the certificate once, then continues.
+settings-web-qr-description = Makes a link and shows it as a code; compare the certificate fingerprint before continuing.
settings-web-qr-show = Show code
settings-web-qr-hide = Hide code
settings-web-qr-loopback = Only the machine it runs on can reach the listener; turn on "Reachable from other devices" for a code a phone can use.
@@ -869,3 +869,5 @@ web-scheme-preview = Preview
web-settings-hover-reveal-description = With the sidebar put away, resting on the left edge shows it until the pointer leaves.
web-settings-agents-panel-description = A panel on the right listing every pane an agent runs in.
web-settings-sidebar-reset-description = Put the sidebar back to its default width.
+
+settings-web-verify-certificate = Compare this SHA-256 with the browser certificate before trusting it.
diff --git a/thinkterm-i18n/i18n/fr-FR.ftl b/thinkterm-i18n/i18n/fr-FR.ftl
index 8c9bc7db..ca5e9be5 100644
--- a/thinkterm-i18n/i18n/fr-FR.ftl
+++ b/thinkterm-i18n/i18n/fr-FR.ftl
@@ -866,3 +866,5 @@ web-scheme-preview = Aperçu
web-settings-hover-reveal-description = Barre latérale rangée, poser le pointeur sur le bord gauche la fait apparaître jusqu’à ce qu’il s’éloigne.
web-settings-agents-panel-description = Un panneau à droite qui liste chaque volet où tourne un agent.
web-settings-sidebar-reset-description = Remettre la barre latérale à sa largeur par défaut.
+
+settings-web-verify-certificate = Comparez cette empreinte SHA-256 à celle du certificat du navigateur avant de lui faire confiance.
diff --git a/thinkterm-i18n/i18n/ja-JP.ftl b/thinkterm-i18n/i18n/ja-JP.ftl
index 82883e32..45a23ec5 100644
--- a/thinkterm-i18n/i18n/ja-JP.ftl
+++ b/thinkterm-i18n/i18n/ja-JP.ftl
@@ -847,3 +847,5 @@ web-scheme-preview = プレビュー
web-settings-hover-reveal-description = サイドバーを閉じているとき、左端にポインターを置くと表示され、離れると戻ります。
web-settings-agents-panel-description = エージェントが動いているペインを一覧する右側のパネル。
web-settings-sidebar-reset-description = サイドバーを既定の幅に戻します。
+
+settings-web-verify-certificate = 信頼する前に、この SHA-256 指紋をブラウザーの証明書と照合してください。
diff --git a/thinkterm-i18n/i18n/zh-CN.ftl b/thinkterm-i18n/i18n/zh-CN.ftl
index ad50b170..611a8b22 100644
--- a/thinkterm-i18n/i18n/zh-CN.ftl
+++ b/thinkterm-i18n/i18n/zh-CN.ftl
@@ -847,3 +847,5 @@ web-scheme-preview = 预览
web-settings-hover-reveal-description = 侧栏收起时,鼠标停在左边缘会临时展开它,离开后收回。
web-settings-agents-panel-description = 右侧的面板,列出每个运行着 Agent 的窗格。
web-settings-sidebar-reset-description = 把侧栏恢复到默认宽度。
+
+settings-web-verify-certificate = 信任前,请核对浏览器证书的 SHA-256;不一致就停止连接。
diff --git a/wezterm-gui/src/settings_window.rs b/wezterm-gui/src/settings_window.rs
index 156d5269..b5c9e2d2 100644
--- a/wezterm-gui/src/settings_window.rs
+++ b/wezterm-gui/src/settings_window.rs
@@ -6163,9 +6163,32 @@ impl SettingsWindow {
let qr_modules = state.qr.as_ref().map(|q| q.len()).unwrap_or(0);
let qr_scale = self.ui_px(4.0);
let qr_side = qr_modules as f32 * qr_scale;
- let qr_extra = if qr_modules > 0 { qr_side + self.ui_px(24.0) } else { 0.0 };
+ let qr_extra = if qr_modules > 0 {
+ qr_side + self.ui_px(24.0)
+ } else {
+ 0.0
+ };
let (card_y, first_row_y) = self.settings_card_geometry(section_y, 5);
- let card_height = self.settings_card_height(5) + qr_extra;
+ let certificates = state.displayed_certificates();
+ let mut certificate_lines = Vec::new();
+ if !certificates.is_empty() {
+ certificate_lines.push(crate::i18n::tr("settings-web-verify-certificate"));
+ for certificate in certificates {
+ certificate_lines.push(certificate.urls.join(" · "));
+ certificate_lines.push("SHA-256:".to_string());
+ let groups: Vec<_> = certificate.sha256.split(':').collect();
+ for chunk in groups.chunks(8) {
+ certificate_lines.push(chunk.join(":"));
+ }
+ }
+ }
+ let certificate_step = self.ui_px(24.0);
+ let certificate_extra = if certificate_lines.is_empty() {
+ 0.0
+ } else {
+ certificate_step * certificate_lines.len() as f32 + self.ui_px(24.0)
+ };
+ let card_height = self.settings_card_height(5) + qr_extra + certificate_extra;
self.paint_group_card(layers, x, card_y, max_width, card_height)?;
// The error takes the description slot rather than a line of its
@@ -6325,6 +6348,19 @@ impl SettingsWindow {
}
}
+ let certificate_y = self.settings_row_description_y(qr_y) + self.ui_px(30.0) + qr_extra;
+ for (index, line) in certificate_lines.iter().enumerate() {
+ self.draw_text(
+ layers,
+ &body_font,
+ row_x,
+ certificate_y + index as f32 * certificate_step,
+ line,
+ palette.text,
+ row_width,
+ )?;
+ }
+
// --- the links --------------------------------------------------
// One extra row for "every link" only when there is more than
// nothing to revoke; an empty list gets the placeholder row alone.
diff --git a/wezterm-gui/src/web_settings.rs b/wezterm-gui/src/web_settings.rs
index 25470aa0..35397a54 100644
--- a/wezterm-gui/src/web_settings.rs
+++ b/wezterm-gui/src/web_settings.rs
@@ -40,6 +40,8 @@ pub struct WebState {
/// A minted link as a QR code (rows of dark modules), shown until the
/// section is left. The code carries the token, as a copied link does.
pub qr: Option<Vec<Vec<bool>>>,
+ /// Public page URL only, without the token fragment. Certificates come from status.
+ pub qr_url: Option<String>,
/// Whether anything has been asked yet, so the first paint of the
/// section can ask without a button.
pub loaded: bool,
@@ -54,6 +56,26 @@ pub struct WebState {
pub generation: u64,
}
+impl WebState {
+ /// Always borrow the latest listener identities, including while a QR stays visible.
+ pub fn displayed_certificates(&self) -> &[codec::WebCertificate] {
+ let certificates = self
+ .status
+ .as_ref()
+ .map(|status| status.certificates.as_slice())
+ .unwrap_or_default();
+ if let (Some(_), Some(url)) = (&self.qr, &self.qr_url) {
+ if let Some(certificate) = certificates
+ .iter()
+ .find(|cert| cert.urls.iter().any(|u| u == url))
+ {
+ return std::slice::from_ref(certificate);
+ }
+ }
+ certificates
+ }
+}
+
/// How often the open page re-reads the server.
///
/// "Is anyone looking at my terminal right now" is the question this page
@@ -336,6 +358,7 @@ pub fn restart(window: Window, bind_address: String) {
with_state(|s| {
s.status = Some(status);
s.qr = None;
+ s.qr_url = None;
});
finish(&window, None, Gate::Action);
refresh(window);
@@ -392,8 +415,14 @@ pub fn show_qr(window: Window, ttl_secs: Option<u64>) {
let rows: Vec<Vec<bool>> = (0..width)
.map(|y| (0..width).map(|x| colors[y * width + x] == qrcode::Color::Dark).collect())
.collect();
- let remark = reachable.is_none().then(|| crate::i18n::tr("settings-web-qr-loopback"));
- with_state(|s| s.qr = Some(rows));
+ let remark = reachable
+ .is_none()
+ .then(|| crate::i18n::tr("settings-web-qr-loopback"));
+ with_state(|s| {
+ s.qr = Some(rows);
+ let page = url.split('#').next().unwrap_or(url);
+ s.qr_url = Some(page.to_string());
+ });
finish(&window, remark, Gate::Action);
refresh(window);
}
@@ -415,7 +444,10 @@ pub fn show_qr(window: Window, ttl_secs: Option<u64>) {
}
pub fn hide_qr() {
- with_state(|s| s.qr = None);
+ with_state(|s| {
+ s.qr = None;
+ s.qr_url = None;
+ });
}
/// Mint a link and put it on the clipboard.
@@ -516,3 +548,44 @@ fn clear_copied_soon(window: Window) {
})
.detach();
}
+
+#[cfg(test)]
+mod certificate_display_tests {
+ use super::*;
+
+ #[test]
+ fn visible_qr_uses_current_identity_and_falls_back_without_a_match() {
+ let certificate = |url: &str, sha256: &str| codec::WebCertificate {
+ urls: vec![url.into()],
+ sha256: sha256.into(),
+ };
+ let mut state = WebState {
+ qr: Some(vec![vec![true]]),
+ qr_url: Some("https://example.test/".into()),
+ status: Some(WebServerStatus {
+ listening: vec![],
+ urls: vec![],
+ configured: vec![],
+ certificates: vec![
+ certificate("https://other.test/", "other"),
+ certificate("https://example.test/", "old"),
+ ],
+ }),
+ ..Default::default()
+ };
+ assert_eq!(state.displayed_certificates().len(), 1);
+ assert_eq!(state.displayed_certificates()[0].sha256, "old");
+ state.status.as_mut().unwrap().certificates[1].sha256 = "rotated".into();
+ assert_eq!(state.displayed_certificates()[0].sha256, "rotated");
+ assert!(
+ state.qr.is_some(),
+ "a status refresh must not hide or recreate the QR"
+ );
+ state.status.as_mut().unwrap().certificates.pop();
+ assert_eq!(state.displayed_certificates()[0].sha256, "other");
+ state.qr_url = None;
+ assert_eq!(state.displayed_certificates().len(), 1);
+ state.status = None;
+ assert!(state.displayed_certificates().is_empty());
+ }
+}
diff --git a/wezterm-mux-server-impl/src/sessionhandler.rs b/wezterm-mux-server-impl/src/sessionhandler.rs
index a20e4a0d..12f292ab 100644
--- a/wezterm-mux-server-impl/src/sessionhandler.rs
+++ b/wezterm-mux-server-impl/src/sessionhandler.rs
@@ -2371,6 +2371,7 @@ impl SessionHandler {
label: minted.label,
token: minted.token,
expires_at: minted.expires_at,
+ certificates: web_certificates(),
urls,
}))
},
@@ -3216,6 +3217,16 @@ mod tests {
/// `urls` names only the listeners that are actually up: a URL for a port
/// nobody is accepting on is worse than no URL, because it looks like the
/// feature is on.
+fn web_certificates() -> Vec<WebCertificate> {
+ crate::web_control::certificates()
+ .into_iter()
+ .map(|(bind, sha256)| WebCertificate {
+ urls: web_urls(&[bind]),
+ sha256,
+ })
+ .collect()
+}
+
fn web_server_status() -> WebServerStatus {
let listening = crate::web_control::listening();
let configured = config::configuration()
@@ -3225,6 +3236,7 @@ fn web_server_status() -> WebServerStatus {
.collect();
WebServerStatus {
urls: web_urls(&listening),
+ certificates: web_certificates(),
listening,
configured,
}
diff --git a/wezterm-mux-server-impl/src/web_control.rs b/wezterm-mux-server-impl/src/web_control.rs
index 71b76927..31553add 100644
--- a/wezterm-mux-server-impl/src/web_control.rs
+++ b/wezterm-mux-server-impl/src/web_control.rs
@@ -21,6 +21,7 @@ pub struct WebControl {
/// defaults, plus whatever the listener filled in itself (a generated
/// certificate) -- so URLs and origins are told the scheme in use.
pub effective: fn(&str) -> Option<config::WebServer>,
+ pub certificates: fn() -> Vec<(String, String)>,
}
static CONTROL: OnceLock<WebControl> = OnceLock::new();
@@ -47,3 +48,8 @@ pub fn listening() -> Vec<String> {
pub fn effective(bind_address: &str) -> Option<config::WebServer> {
get().and_then(|c| (c.effective)(bind_address))
}
+
+/// Bind address and SHA-256 for each live TLS listener; HTTP has no entry.
+pub fn certificates() -> Vec<(String, String)> {
+ get().map(|c| (c.certificates)()).unwrap_or_default()
+}
diff --git a/wezterm-mux-server/src/main.rs b/wezterm-mux-server/src/main.rs
index 35a5939d..264cb59c 100644
--- a/wezterm-mux-server/src/main.rs
+++ b/wezterm-mux-server/src/main.rs
@@ -369,6 +369,7 @@ fn run() -> anyhow::Result<()> {
stop: web::stop_web_listener,
listening: web::listening,
effective: web::effective,
+ certificates: web::certificates,
},
);
diff --git a/wezterm-mux-server/src/web.rs b/wezterm-mux-server/src/web.rs
index 0dd75c0a..40683a52 100644
--- a/wezterm-mux-server/src/web.rs
+++ b/wezterm-mux-server/src/web.rs
@@ -33,6 +33,7 @@ struct Listening {
/// What the listener runs with: the entry as given, plus the
/// certificate it made for itself when the entry named none.
effective: WebServer,
+ fingerprint: Option<String>,
stop: Arc<AtomicBool>,
/// The address `accept()` actually returned, not the configured
/// string: an unspecified bind has to be woken through a real address.
@@ -55,6 +56,33 @@ pub fn effective(bind_address: &str) -> Option<WebServer> {
.map(|l| l.effective.clone())
}
+/// Captured from the loaded SSL context; disk rotation cannot change a live
+/// listener's identity until that listener is restarted.
+pub fn certificates() -> Vec<(String, String)> {
+ LISTENERS
+ .lock()
+ .unwrap_or_else(|e| e.into_inner())
+ .iter()
+ .filter_map(|(bind, live)| {
+ live.fingerprint
+ .as_ref()
+ .map(|fp| (bind.clone(), fp.clone()))
+ })
+ .collect()
+}
+fn certificate_fingerprint(acceptor: &SslAcceptor) -> anyhow::Result<String> {
+ let certificate = acceptor
+ .context()
+ .certificate()
+ .context("TLS listener has no certificate")?;
+ let digest = certificate.digest(openssl::hash::MessageDigest::sha256())?;
+ Ok(digest
+ .iter()
+ .map(|byte| format!("{byte:02x}"))
+ .collect::<Vec<_>>()
+ .join(":"))
+}
+
pub fn is_listening(bind_address: &str) -> bool {
LISTENERS
.lock()
@@ -207,9 +235,11 @@ pub fn spawn_web_listener(server: &WebServer) -> anyhow::Result<()> {
let mut effective = server.clone();
if !server.is_loopback() && !server.uses_tls() && server.require_tls_off_loopback {
let tls = wezterm_mux_server_impl::web_tls::ensure(&config::local_addresses())
- .with_context(|| format!("web server {}: making its certificate", server.bind_address))?;
+ .with_context(|| {
+ format!("web server {}: making its certificate", server.bind_address)
+ })?;
log::error!(
- "web server {}: {} self-signed certificate {} (SHA-256 {}); browsers warn once, then continue",
+ "web server {}: {} self-signed certificate {} (SHA-256 {}); compare this fingerprint with the browser certificate before trusting",
server.bind_address,
if tls.generated { "made a" } else { "using the" },
tls.cert.display(),
@@ -224,6 +254,7 @@ pub fn spawn_web_listener(server: &WebServer) -> anyhow::Result<()> {
} else {
None
};
+ let fingerprint = acceptor.as_ref().map(certificate_fingerprint).transpose()?;
let static_dir = resolve_static_dir(server);
match &static_dir {
Some(dir) => log::info!("web bundle for {} at {}", server.bind_address, dir.display()),
@@ -252,15 +283,19 @@ pub fn spawn_web_listener(server: &WebServer) -> anyhow::Result<()> {
let done = Arc::new(AtomicBool::new(false));
// Registered before the thread starts, so a stop that arrives in the
// same breath as the start still finds it.
- LISTENERS.lock().map_or_else(|e| e.into_inner(), |g| g).insert(
- server.bind_address.clone(),
- Listening {
- effective: effective.clone(),
- stop: Arc::clone(&stop),
- local,
- done: Some(Arc::clone(&done)),
- },
- );
+ LISTENERS
+ .lock()
+ .map_or_else(|e| e.into_inner(), |g| g)
+ .insert(
+ server.bind_address.clone(),
+ Listening {
+ effective: effective.clone(),
+ fingerprint,
+ stop: Arc::clone(&stop),
+ local,
+ done: Some(Arc::clone(&done)),
+ },
+ );
let bind_address = server.bind_address.clone();
match std::thread::Builder::new()
.name(format!("web-accept-{}", server.bind_address))
@@ -422,3 +457,49 @@ fn accept_loop(
}
}
}
+
+#[cfg(test)]
+mod certificate_tests {
+ use super::*;
+ #[test]
+ fn identities_follow_live_listeners_and_ignore_plain_http() {
+ let first = crate::ossl::deadline_tests::test_acceptor();
+ let second = crate::ossl::deadline_tests::test_acceptor();
+ let first_fp = certificate_fingerprint(&first).unwrap();
+ let second_fp = certificate_fingerprint(&second).unwrap();
+ assert_ne!(first_fp, second_fp);
+ assert_eq!(first_fp.split(':').count(), 32);
+ let binds = ["127.0.0.1:0", "127.0.0.2:0", "127.0.0.3:0"];
+ for (bind, fingerprint) in
+ binds
+ .iter()
+ .zip([Some(first_fp.clone()), Some(second_fp.clone()), None])
+ {
+ LISTENERS.lock().unwrap().insert(
+ (*bind).into(),
+ Listening {
+ effective: WebServer {
+ bind_address: (*bind).into(),
+ ..Default::default()
+ },
+ fingerprint,
+ stop: Arc::new(AtomicBool::new(false)),
+ local: bind.parse().unwrap(),
+ done: None,
+ },
+ );
+ }
+ let fingerprints = certificates();
+ assert!(fingerprints.contains(&(binds[0].into(), first_fp.clone())));
+ assert!(fingerprints.contains(&(binds[1].into(), second_fp)));
+ assert!(!fingerprints.iter().any(|(bind, _)| bind == binds[2]));
+ // Building a replacement context did not change the old listener.
+ assert_eq!(certificate_fingerprint(&first).unwrap(), first_fp);
+ for bind in binds {
+ assert!(stop_web_listener(bind));
+ }
+ assert!(!certificates()
+ .iter()
+ .any(|(bind, _)| binds.contains(&bind.as_str())));
+ }
+}
diff --git a/wezterm/src/cli/web_token.rs b/wezterm/src/cli/web_token.rs
index 197e4546..5a641604 100644
--- a/wezterm/src/cli/web_token.rs
+++ b/wezterm/src/cli/web_token.rs
@@ -152,6 +152,14 @@ impl MintCommand {
None => println!("Does not expire; revoke it with `thinkterm cli web-token revoke {}`.", minted.id),
}
println!();
+ for certificate in &minted.certificates {
+ println!("Certificate for {}", certificate.urls.join(", "));
+ println!("SHA-256: {}", certificate.sha256);
+ }
+ if !minted.certificates.is_empty() {
+ println!("Compare this fingerprint with the browser's certificate before trusting it. If it differs, stop.");
+ println!();
+ }
println!("This token is a login as your user on this machine. Anyone holding it can");
println!("open a shell and read every pane. Treat it like an ssh key.");
println!();