Commit Graph
25 Commits
Author SHA1 Message Date
世界 08eaa2878c Send reality fallback request before returning
When authentication failed, the reality client returned the error and
sent the fallback request from a goroutine on the same connection. The
TLS dialer closes the connection when the handshake returns an error, so
the request always failed with "use of closed network connection" and
the client closed the connection right after the target's handshake.
Send the request within the handshake context before returning the
error, so the caller owns the connection again once it gets the error.
2026-11-14 07:52:37 +00:00
世界 25d6a21f75 Use configured time and root pool in reality client
The reality session id carried time.Now() instead of the configured
time, which is the NTP clock when ntp is enabled, so a client whose
system clock was off failed every handshake against a server that sets
max_time_difference. The certificate check after a failed
authentication also used the system clock and system roots instead of
the configured clock and certificate store, so it rejected a valid
target and skipped the fallback request.
2026-11-14 07:52:37 +00:00
世界 0a03261e79 Send reality client version 1.8.2
Xray-core v26.7.11 to v26.9.7 refused REALITY clients older than
26.3.27 unless the server set minClientVer, and operators set it to
1.8.2, the version mihomo sends, to let third-party clients connect.
The setting stays after Xray-core dropped that default, and it rejects
sing-box, which sends 1.8.1. The version is only checked against the
server's minClientVer and maxClientVer, and Xray-core never released a
1.8.2, so send the same version as mihomo.
2026-11-14 07:52:37 +00:00
世界 2cd3e2f848 Remove ineffective ALPN override from reality client
BuildHandshakeState already copied the fingerprint's ALPN into the
config, so the loop assigned the extension its own protocols. The
reality ClientHello keeps carrying the fingerprint's ALPN, as in
Xray-core.
2026-11-14 07:52:37 +00:00
世界 39501357a5 Stop removing X25519MLKEM768 from reality ClientHello
Xray-core v26.9.8 and later REALITY servers reject a ClientHello that
has no X25519MLKEM768 key share ahead of X25519 and fall back to the
target, so sing-box reality clients failed against them with "reality
verification failed". Removing the group and share also made the chrome
hello differ from the browser it imitates. Send the fingerprint's key
shares unchanged, as Xray-core does.

The randomized fingerprint picked the X25519MLKEM768 group and key share
with separate coin flips. A group without a share makes post-quantum
preferring servers send a HelloRetryRequest, which uTLS cannot answer
for X25519MLKEM768 and REALITY cannot relay; a share without the group
is rejected by OpenSSL with illegal_parameter. Always offer both.
2026-11-14 07:52:37 +00:00
世界 42f487bd0d Fix IPv6 literal host handling 2026-10-23 19:57:05 +08:00
世界 60f0a0369b Fix half-close not propagating through connection wrappers 2026-09-20 22:24:38 +08:00
世界 40e2b5fd4b Add TLS spoof support 2026-08-30 17:41:39 +08:00
世界 2515811356 Refactor: HTTP clients, unified HTTP2/QUIC options, Apple engines 2026-08-30 17:41:39 +08:00
世界 5e7fd7ad78 Fix lint errors 2026-05-13 23:39:27 +08:00
世界 e9c46cc359 Improve compatibility for kTLS 2026-01-17 05:46:00 +08:00
世界 107f92381b Add support for kTLS
Reference: https://gitlab.com/go-extension/tls
2026-01-17 05:44:42 +08:00
世界 1468d83895 Make realityClientConnWrapper replaceable 2025-08-20 16:26:27 +08:00
Restia-Ashbelland世界 c0588c30d7 Add ECH support for uTLS 2025-07-08 13:14:44 +08:00
世界 dbdcce20a8 Update utls to v1.7.2 2025-07-08 13:12:35 +08:00
世界 17576e9f66 Add certificate store 2025-07-08 13:12:14 +08:00
世界 50f5006c43 Fix leak in reality server 2025-01-07 17:27:10 +08:00
世界 fe053e26b5 Update uTLS to 1.5.4 2024-01-03 12:21:47 +08:00
世界 5b343d4c72 Improve ECH support 2023-09-12 13:26:19 +08:00
世界 8eb7dd0059 Improve VLESS request 2023-06-07 20:35:00 +08:00
世界 e50b334b9a Fix uTLS ALPN 2023-05-19 15:41:18 +08:00
世界 4feee983b5 Update reality protocol 2023-04-06 19:05:05 +08:00
世界 70cf681ff2 Remove length limit on short_id for reality TLS config 2023-03-13 19:46:16 +08:00
世界 3b4e811907 Add reality client fallback 2023-02-28 20:55:14 +08:00
世界andGitHub fbc94b9e3e Add VLESS server, vision flow and reality TLS 2023-02-25 16:24:08 +08:00