QUIC clients took the standard TLS config directly, so with ECH enabled
and no static config, hysteria, hysteria2, tuic and DNS over QUIC never
queried the ECH config list and sent the real server name in the clear
without reporting an error. Query it before the QUIC handshake as the
TCP path does.
When ECH is enabled without a static config, the HTTPS record query for
the ECH config list went through the DNS rules instead of the domain
resolver, and the migration of outbound DNS rule items to the domain
resolver left no way to select a DNS server for it. A rule rejecting
HTTPS records refused the query, and a default DNS server detoured
through the same outbound waited for its own connection until the query
timed out.
Send the query to the domain resolver of the dial fields, then the
default domain resolver, then the only DNS server, and fail it when
none of them is available. DNS servers must set their own domain
resolver for it, as they do for a domain server address.
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.
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.
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.
The random fingerprint picked one of chrome, firefox, edge, safari and
ios per process. Edge 85 and iOS 14 are no longer current browsers and
send no X25519MLKEM768 key share, so a process that picked one of them
failed every REALITY handshake against Xray-core v26.9.8 and later
servers. Pick only from fingerprints of current browsers.
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.
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.