mirror of
https://github.com/tailscale/tailscale.git
synced 2026-10-29 06:28:57 -04:00
runServeSetConfig built every non-file, non-unix endpoint target as "<protocol>://<host:port>", so a tls-terminated-tcp endpoint produced the target tls-terminated-tcp://host:port. applyTCPServe accepts only the tcp and unix target schemes, and it takes TLS termination from the serve type rather than from the target. Every such endpoint therefore failed with "unable to expand target". The flag form already works because it passes --tls-terminated-tcp=<port> together with a tcp://host:port target. Build the target with the tcp scheme whenever the serve type is TCP or TLS-terminated TCP. Plain tcp endpoints already used that scheme, so only tls-terminated-tcp endpoints change. https+insecure needs no mapping, since the web path accepts it as a target scheme, and unix targets skip scheme construction entirely. Fixes #21786 Signed-off-by: Vivek1898 <72497717+Vivek1898@users.noreply.github.com>