Linux系统下tailscale客户端使用http登入headscale

说明

本文说明在 Linux 系统下使用 tailscale 客户端 登入 http 协议的 headscale
Tailscale 客户端默认使用 https 协议。

  • Ubuntu 24.04 LTS
  • headscale v0.26.1
  • tailscale 客户端版本 1.86.2

tailscale客户端安装

1
2
3
4
5
6
7
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/noble.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null

curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/noble.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list

sudo apt-get update

sudo apt-get install tailscale

问题

linux(ubuntu 24.04)系统中安装了 tailscale 客户端,但是程序启动后,再登入自定的 headscale 服务端(如果是 http,没有ssl证书)会一直卡在登入环节。

Tailscale 客户端登入信息如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Aug 06 08:00:42 ding tailscaled[828]: Received error: register request: Post "https://124.232.182.156:8081/machine/register": connection attempts aborted by context: context deadline exceeded 
Aug 06 08:00:43 ding tailscaled[828]: control: doLogin(regen=false, hasUrl=false)
Aug 06 08:00:43 ding tailscaled[828]: control: control server key from http://124.232.182.156:8081: ts2021=[QNt10], legacy=
Aug 06 08:00:43 ding tailscaled[828]: control: RegisterReq: onode= node=[V20sD] fup=false nks=false
Aug 06 08:00:43 ding tailscaled[828]: control: controlhttp: forcing port 443 dial due to recent noise dial
Aug 06 08:00:53 ding tailscaled[828]: Received error: register request: Post "https://124.232.182.156:8081/machine/register": connection attempts aborted by context: context deadline exceeded
Aug 06 08:00:54 ding tailscaled[828]: control: doLogin(regen=false, hasUrl=false)
Aug 06 08:00:54 ding tailscaled[828]: control: control server key from http://124.232.182.156:8081: ts2021=[QNt10], legacy=
Aug 06 08:00:54 ding tailscaled[828]: control: RegisterReq: onode= node=[V20sD] fup=false nks=false
Aug 06 08:00:54 ding tailscaled[828]: control: controlhttp: forcing port 443 dial due to recent noise dial
Aug 06 08:01:04 ding tailscaled[828]: Received error: register request: Post "https://124.232.182.156:8081/machine/register": connection attempts aborted by context: context deadline exceeded
Aug 06 08:01:05 ding tailscaled[828]: control: doLogin(regen=false, hasUrl=false)
Aug 06 08:01:05 ding tailscaled[828]: control: control server key from http://124.232.182.156:8081: ts2021=[QNt10], legacy=
Aug 06 08:01:05 ding tailscaled[828]: control: RegisterReq: onode= node=[V20sD] fup=false nks=false
Aug 06 08:01:05 ding tailscaled[828]: control: controlhttp: forcing port 443 dial due to recent noise dial
Aug 06 08:01:15 ding tailscaled[828]: Received error: register request: Post "https://124.232.182.156:8081/machine/register": connection attempts aborted by context: context deadline exceeded
Aug 06 08:01:16 ding tailscaled[828]: control: doLogin(regen=false, hasUrl=false)
Aug 06 08:01:16 ding tailscaled[828]: control: control server key from http://124.232.182.156:8081: ts2021=[QNt10], legacy=
Aug 06 08:01:16 ding tailscaled[828]: control: RegisterReq: onode= node=[V20sD] fup=false nks=false
Aug 06 08:01:16 ding tailscaled[828]: control: controlhttp: forcing port 443 dial due to recent noise dial
Aug 06 08:01:24 ding kernel: workqueue: drain_vmap_area_work hogged CPU for >10000us 4 times, consider switching to WQ_UNBOUND
Aug 06 08:01:26 ding tailscaled[828]: Received error: register request: Post "https://124.232.182.156:8081/machine/register": connection attempts aborted by context: context deadline exceeded
Aug 06 08:01:28 ding tailscaled[828]: control: doLogin(regen=false, hasUrl=false)
Aug 06 08:01:28 ding tailscaled[828]: control: control server key from http://124.232.182.156:8081: ts2021=[QNt10], legacy=
Aug 06 08:01:28 ding tailscaled[828]: control: RegisterReq: onode= node=[V20sD] fup=false nks=false
Aug 06 08:01:28 ding tailscaled[828]: control: controlhttp: forcing port 443 dial due to recent noise dial
Aug 06 08:01:38 ding tailscaled[828]: Received error: register request: Post "https://124.232.182.156:8081/machine/register": connection attempts aborted by context: context deadline exceeded
Aug 06 08:01:40 ding tailscaled[828]: control: doLogin(regen=false, hasUrl=false)
Aug 06 08:01:40 ding tailscaled[828]: control: control server key from http://124.232.182.156:8081: ts2021=[QNt10], legacy=
Aug 06 08:01:40 ding tailscaled[828]: control: RegisterReq: onode= node=[V20sD] fup=false nks=false
Aug 06 08:01:40 ding tailscaled[828]: control: controlhttp: forcing port 443 dial due to recent noise dial
Aug 06 08:01:50 ding tailscaled[828]: Received error: register request: Post "https://124.232.182.156:8081/machine/register": connection attempts aborted by context: context deadline exceeded
Aug 06 08:01:52 ding tailscaled[828]: control: doLogin(regen=false, hasUrl=false)
Aug 06 08:01:52 ding tailscaled[828]: control: control server key from http://124.232.182.156:8081: ts2021=[QNt10], legacy=
Aug 06 08:01:52 ding tailscaled[828]: control: RegisterReq: onode= node=[V20sD] fup=false nks=false
Aug 06 08:01:52 ding tailscaled[828]: control: controlhttp: forcing port 443 dial due to recent noise dial

可以看到登入日志中出现了 https://124.232.182.156:8081tailscale 客户端会访问 https 的服务器,显然是无法访问成功的,因为服务器就没有配置 ssl

解决

删除 /var/lib/tailscale/tailscaled.state 文件,然后重新登入就可以了。