Files
mu300-linux/rootfs
Abdurrahman Kaan DikeçandClaude Opus 5.5 2d444befaf vpn: Xray engine on a kernel TUN, with a self-managing certificate pin
mu300-vpn gains ENGINE=xray, now the default: Xray-core speaks VLESS and hev-socks5-tunnel owns a plain kernel TUN
(xtun), handing every flow to Xray's SOCKS port on loopback. It reads the same VLESS_URI through the same parser;
ENGINE=sing-box keeps the old engine, and an image without the xray binaries falls back to it by itself.

The script does the routing neither program does, with sing-box's rule prefs and table so routing_cleanup and the
kill switch cover both: Xray's own sockets carry the 0x2d0 mark to main, the LAN and the server's address go to
main, everything else to xtun, and the device's own DNS is DNAT'd to REMOTE_DNS. The server name is resolved
before any of that exists and handed to Xray as an address. Xray, hev and the rules are torn down together on
every exit path.

Xray 26 removed allowInsecure. For a link that asks for it the leaf certificate is fetched with openssl once,
pinned as TLS_PIN_SHA256 in vpn.conf, and re-fetched only when Xray reports a pin mismatch (a renewal), after which
the service restarts. That report is info-level, so Xray runs at info and only warnings reach the system log.

Release: tools/fetch-xray.sh pins both binaries by sha256; make-release, assemble.sh and the OpenWrt build carry
them, and both images get openssl. The example config ships KILL_SWITCH=0 until the kill switch is re-tested
with Xray.

Measured on OpenWrt on the device: exit IP is the server's, apk works through the tunnel, a Wi-Fi client is
forwarded into xtun, and the three pin paths (none, present, mismatched) behave as described. Ubuntu is not yet
run on the device. FINDINGS 26e also records that busybox nc here has no -w - the reason an earlier test read
every destination as closed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-22 23:16:46 +03:00
..