Linked environments selects a Tailscale IP that its security check rejects #26450
What happened#
In the Mac desktop app, linking an existing SSH-connected Linux environment through Settings → Linked environments → Link fails. T3 automatically tries the machine’s LAN and numeric Tailscale addresses, then rejects both as unsafe plain HTTP.
The Linux environment remains connected through SSH over Tailscale.
Diagnosis#
Current upstream source shows a mismatch between automatic address selection and link validation.
PeerLinks.ts rejects non-loopback HTTP origins unless isTailnetHost accepts the hostname.
isTailnetHost accepts .ts.net names and Tailscale IPv6 addresses, but deliberately excludes numeric shared-space IPv4 addresses.
The automatic linking flow supplied a numeric IPv4 address confirmed by tailscale status to belong to the target machine. That address therefore cannot pass validation.
Source references are from upstream, not a verified copy of the installed bundle. No automated reproduction was run.
Steps to reproduce#
- Connect the Mac desktop app to a Linux environment using SSH through its Tailscale MagicDNS hostname.
- Open Settings → Linked environments → Link on the Mac environment.
- Select the existing Linux environment and attempt to link it.
- Observe T3 automatically trying LAN and numeric Tailscale HTTP addresses.
- Both addresses are rejected with the error below.
Expected behavior: automatic linking selects a usable, trusted route or explains how to configure one.
Version#
User reports the latest nightly. Local triage context recorded Mac server version 0.1.4-nightly.20261028.3814. Exact desktop and remote Linux build versions were not independently verified.
Triage CLI version was 0.1.2.
Environment#
Mac desktop app on macOS, Darwin 25.6.0, arm64. Local Node version v26.12.1.
Remote Linux environment connected through SSH over Tailscale. tailscale status confirms the target is active with a direct connection.
Evidence#
Addresses below are anonymized, retaining their relevant ranges.
PeerLinkError: This environment could not reach linux:
http://192.168.1.20:3773/ is plain http, which would send the link's credentials unencrypted. Use its https address, or its Tailscale address.
http://100.105.1.20:3773/ is plain http, which would send the link's credentials unencrypted. Use its https address, or its Tailscale address.
Related issues#
#26431 concerns credentials sent over plain HTTP. This report concerns automatic linking selecting a confirmed Tailscale address that its own validation rejects. No exact duplicate was found.
Fix applied or workaround#
No configuration changes were made. Manually linking through the machine’s .ts.net hostname was suggested but has not been tested.
Filed by#
Codex, GPT-6.1-sol, via t3 triage.
Still reproducible on the macOS desktop app, version
0.1.6-nightly.20261029.3892(arm64).Linking my Linux environment automatically selected its numeric Tailscale address (
http://100.x.x.x:3773/), then rejected it as plain HTTP.Workaround confirmed: manually adding and linking through
http://<machine>.<tailnet>.ts.net:3773/succeeded. Both linked environments now show Reachable.The numeric address was reachable; the failure was T3’s address validation.
Investigated with Codex, GPT-6.1-sol.
Still reproduces on
0.1.7-nightly.20261102.4093, andt3 environment link http://100.x.x.x:3773 --pairing-code …from the CLI fails the same way as the UI.One extra detail: because the peer's
127.0.0.1URL answers (as the caller itself), the error shown is the generic "could not reach at " instead of the actual cause (the plain-http refusal), so it looks like a network problem. Surfacing the refusal reasons in that message would have saved a lot of debugging.(Comment written with Claude Code on behalf of @Bafff.)
Also reproduces on stable v0.1.7 at both ends: two macOS desktop apps (darwin arm64, macOS 27.2) on the same tailnet, with a direct Tailscale connection between them. I picked the MacBook in Settings → Linked environments → + Link on the Mac mini, and it fails every time.
The error shown:
PeerLinkError: This environment could not reach <MacBook> at http://192.168.1.127:3773/, http://100.64.96.40:3773/, https://<macbook>.<tailnet>.ts.net/, http://127.0.0.1:3773/.What each URL did (from the Mac mini's
server.trace.ndjson;PeerLinks.answeringAsgave up after about 83 ms, 2026-11-04 13:17:34 UTC):URL Result http://192.168.1.127:3773Refused by peerOrigin(plain http to a LAN address); no request senthttp://100.64.96.40:3773Refused by peerOrigin, becauseisTailnetHostdoesn't accept 100.64/10 IPv4; no request senthttps://<macbook>.<tailnet>.ts.netHttpClientError: Transport error, because the linking machine has Tailscale DNS (--accept-dns) off, so MagicDNS names don't resolvehttp://127.0.0.1:3773Answered 200, but from the linking machine's own server, so its environment ID didn't match Further detail for this thread:
- Only the
.ts.netURL passes the security check, and Tailscale config can make it unreachable without T3 saying so. In this setup it also depends on the target allowing inbound tailnet connections. The target hasShieldsUp: true, so TCP from the peer to100.64.96.40times out on every port even thoughtailscale pingsucceeds. T3's error says nothing about this. Users who keep Shields Up on, or MagicDNS off, have no working link path at all, even though both machines see each other on the tailnet. - The
127.0.0.1answer hides the real cause again here. Because one URL succeeded (as the wrong environment),refusals.length !== checked.length, so the message drops the "plain http" refusals and looks like a network outage. Reporting each URL's outcome, or not counting a mismatched environment ID as a success, would have made this a one-minute diagnosis. - The advertised list includes the target's own
http://127.0.0.1:3773/, which can never reach the target from another machine.
Environment: both ends run T3 Code (Beta) desktop v0.1.7, stable channel, macOS 27.2 arm64, server
databaseMigration79. The target exposes T3 viatailscale serve(tailnet only) proxying to127.0.0.1:3773.Workaround: none that keeps these Tailscale settings. #26475 (accept a Tailscale machine's 100.x address) would fix this case. Note it would still need Shields Up off on the target, since the link needs an inbound connection.
Triaged with Claude Code (Opus 5.5,
claude-opus-5-5) viat3 triage.- Only the
tanstack-source added labelsbug
Filed by Claude Opus 5.5 on behalf of Davies (@daviesayo).
This still happens on 0.1.10-nightly.20261116.4761 at both ends. The client is the macOS desktop app and the target is an Ubuntu 26.04 server running
t3 serve.What I saw: In Settings → Linked environments → Link, I picked the Linux machine and Link failed with:
PeerLinkError: This environment could not reach ship: http://192.168.87.35:3773/ is plain http, which would send the link's credentials unencrypted. Use its https address, or its Tailscale address.The desktop app already listed two routes for that machine,
http://<host>.<old-tailnet>.ts.net:3773/andhttp://100.126.40.81:3773/ · found automatically(marked In use). Link still chose the LAN address, which is not one of those routes.peerOrigininapps/server/src/peer/PeerLinks.tsrejects it, becauseisTailnetHostaccepts only*.ts.netnames and Tailscale IPv6.What fixed it: I set up Tailscale Serve on the target so it has
https://<host>.<tailnet>.ts.net/. Then I added that machine again with an HTTPS pairing URL, and Link worked. A user without Tailscale Serve has no way to link over Tailscale.The setup step has its own problem:
t3 pair --tailscalefails without telling the user to set the Tailscale operator. I'm filing that separately.Headscale adds a case where the
*.ts.networkaround above does not exist.Headscale nodes run the real Tailscale client and get the usual
100.64.0.0/10andfd7a:115c:a1e0::/48addresses. But MagicDNS names use the domain the operator chose (here<node>.<tailnet-domain>), never*.ts.net. Headscale also can't issue Tailscale certificates:tailscale status --jsonshowsCertDomains: null, andtailscale certreturns500 Internal Server Error: your Tailscale account does not support getting TLS certs. So without a reverse proxy, the only plain-http addresspeerOriginaccepts is the Tailscale IPv6 one. That only works if the target server listens on IPv6. The Linux desktop app here listens on0.0.0.0:3774, IPv4 only.With
t3 environment link <url> --pairing-code …(Tailscale 1.104.6, Headscale control server,BackendState: Running,TUN: true):URL Result http://<node>.<tailnet-domain>:3773/PeerLinkError: … is plain http, which would send the link's credentials unencrypted. Use its https address, or its Tailscale address.http://100.64.x.y:3773/same refusal http://[fd7a:115c:a1e0::N]:3773/passes peerOrigin(fails later only on the deliberately invalid test code)CLI
0.1.8-nightly.20261107.4340.isTailnetHostand thepeerOrigincheck are unchanged on main8cf97b5f06.#26475's approach would cover Headscale's numeric addresses without special handling, because it checks
TailscaleIPsfrom the local client'stailscale statusrather than a domain name. The MagicDNS name would still be refused, but the100.xroute would work.Written with Claude Code (Claude Opus 5.5) on behalf of @dna113p.
Still reproduces on 0.1.12-nightly.20261123.5138 (Windows desktop app linking to a headless Linux host running
t3 servewithT3CODE_LAN=true,T3CODE_HOST=::over a self-hosted Headscale tailnet with a custom MagicDNS suffix andCertDomains: null).What happens#
- In
apps/server/src/environment/DirectEndpoints.ts(resolveBoundEndpoints), wildcard binds (::/0.0.0.0) identify the Tailscale interface via itsfd7a:115c:a1e0::/48IPv6 address, but filter advertised endpoints strictly toentry.family === "IPv4"— publishinghttp://100.64.x.x:3773/withkind: "tailnet"and omitting the Tailscale IPv6 address. (By contrast, the non-wildcard branch explicitly allowsNodeNet.isIPv6(address) && isTailnetHost(address).) PeerLinks.ts(peerOrigin->isTailnetHost) then rejects that advertised100.64.x.xaddress as plain HTTP, along with all LAN addresses, causing the Link picker / thread link request card to fail with:... is plain http, which would send the link's credentials unencrypted. Use its https address, or its Tailscale address.
Workaround#
Linking manually via the CLI with the target's Tailscale IPv6 address (
tailscale ip -6 <host>) works end-to-end over direct local WireGuard without needing T3 Connect:t3 environment link "http://[fd7a:115c:a1e0::x]:3773" --pairing-code <CODE> --access full-access+1 on #43338 (and advertising the Tailscale IPv6 endpoint in the wildcard branch of
resolveBoundEndpointswould also let IPv6-capable tailnets work out of the box).- In
Sign in to join this conversation.
Still reproduces on
0.1.6-nightly.20261029.3892(both ends: Linux desktop AppImage → macOS desktop app, same tailnet, direct connection), via Settings → Linked environments → + Link, picking the machine from the list.One more detail that makes this harder to diagnose: the peer's advertised URLs include its own
http://127.0.0.1:3773/. From the linking machine that loopback address answers as the local environment, soansweringAsgets one success with a non-matchingenvironmentId. Because not every address was refused, therefusals.length === checked.lengthbranch is skipped and the user gets the generic message with no reasons:The span
PeerLinks.answeringAsfailed in ~8 ms. Both non-loopback addresses answer/.well-known/t3/environmentwith the rightenvironmentIdvia curl from the linking machine. The real reasons (plain-http LAN and numeric Tailscale IPv4 both refused bypeerOrigin) are never shown.Suggestions: don't offer a peer's loopback address to another machine, report refusals even when some other address answered as the wrong environment, and offer the peer's MagicDNS
*.ts.netname, whichisTailnetHostaccepts.Workaround that works:
t3 environment link http://<machine>.<tailnet>.ts.net:3773 --pairing-code <code> --access full-access, where the code comes fromt3 auth pairing create --scope orchestration:read --scope orchestration:operate --scope settings:write --scope source-control:writeon the peer. Linked and reachable.Produced by Claude Code (Claude Opus 5.5) via
t3 triage(triage CLI 0.1.5).