Files
xmz7891 b62ac865ea ykxmz 1.5.0:修复手表端 TLS 证书校验 + MTU 修复网络稳定性
被控端
- 修复 MTU 问题:夹 MSS + 路径 MTU 探测(公网可用率 48% -> 100%)
- 复用 HTTP 连接(免掉每次新建 TLS 的 30% 握手失败)
- 每分钟回头找局域网,自动切回快 400 倍的路径
- 画面心跳帧:静止时省流量,客户端仍知道流是活的
- 锁屏时给出可操作的提示

手表端
- 内置 GTS Root R4 / GlobalSign Root CA,修 SSLHandshakeException
- 连接错误翻译成人话(证书/时间/解析/超时分别提示)
- 经中转连上后用服务器报的地址刷新已配对记录
- 新增局域网连接页面、服务器延迟检测

服务器端
- 支持 chunked 请求体(修每 16 秒一次的连接错乱与大面积 502)
- 网络调优脚本 net-tune.sh(开机自动应用)
- 管理页:批量删除、网络体检、下载区
- 隧道改 HTTP/2 + 双连接

文档
- 许可协议 / 安装前必读 / 安装后须知(作者:小麦子)
2026-10-06 19:01:05 +08:00

69 lines
2.5 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 取出 relay.xxmxxs.top 证书链上的根/中间证书,准备打进 APK。
#
# 背景:手表报 SSLHandshakeException: Chain validation failed
# 链路是 xxmxxs.top <- GTS WE1 <- GTS Root R4 <- GlobalSign Root CA
# 廉价手表的根证书库常常缺 GTS Root R4,
# 于是找不到信任锚 -> 握手失败。
# 把这两个根打进 APK,校验时"系统库 + 内置"任一通过即可。
set -u
OUT=/root/ca-bundle
mkdir -p "$OUT"
cd "$OUT"
echo "===== 抓完整证书链 ====="
echo | openssl s_client -showcerts -connect relay.xxmxxs.top:443 \
-servername relay.xxmxxs.top 2>/dev/null > /root/chain.txt
grep -c 'BEGIN CERTIFICATE' /root/chain.txt | sed 's/^/ 链上证书数: /'
# 把每张证书拆出来
awk '/BEGIN CERTIFICATE/,/END CERTIFICATE/' /root/chain.txt > /root/chain.pem
csplit -z -f "$OUT/cert" -b "%02d.pem" /root/chain.pem \
'/-----BEGIN CERTIFICATE-----/' '{*}' >/dev/null 2>&1 || true
echo
echo "===== 每张证书的信息 ====="
for f in "$OUT"/cert*.pem; do
[ -f "$f" ] || continue
echo " --- $(basename "$f") ---"
openssl x509 -in "$f" -noout -subject -issuer 2>/dev/null \
| sed 's/^/ /'
done
echo
echo "===== 找 GTS Root R4 的自签名证书 ====="
# GTS Root R4 是通过 GlobalSign 交叉签名的;
# 真正需要内置的是**自签名的根**(GTS Root R4 self-signed 与 GlobalSign Root CA)。
for candidate in \
"https://i.pki.goog/r4.crt" \
"https://pki.goog/repo/certs/gtsr4.pem" \
"https://pki.goog/repo/certs/gsr2.pem"; do
name=$(basename "$candidate")
if curl -s --max-time 20 -o "$OUT/$name" "$candidate" 2>/dev/null \
&& [ -s "$OUT/$name" ]; then
# 有的下载下来是 DER,转成 PEM
if ! grep -q 'BEGIN CERTIFICATE' "$OUT/$name" 2>/dev/null; then
openssl x509 -inform DER -in "$OUT/$name" \
-out "$OUT/${name}.pem" 2>/dev/null \
&& rm -f "$OUT/$name"
fi
echo " ✓ $candidate"
openssl x509 -in "$OUT/${name}.pem" -noout -subject -issuer 2>/dev/null \
| sed 's/^/ /'
else
echo " ✗ $candidate"
fi
done
echo
echo "===== 系统里现成的根证书(Debian 上有)====="
for name in "GlobalSign_Root_CA.pem" "gtsrootr4.pem" "GTS_Root_R4.pem"; do
found=$(find /etc/ssl/certs /usr/share/ca-certificates -name "$name" 2>/dev/null | head -1)
[ -n "$found" ] && echo " ✓ $found"
done
echo
echo "===== 汇总可用的 PEM ====="
ls -la "$OUT"/*.pem 2>/dev/null | sed 's/^/ /'