reality verification failed: why VLESS Reality won't connect

The error reality verification failed means the client didn't get your server's answer. The server didn't recognize the client and passed the connection on to the masking site, so the client met a real website instead of a VPN. Almost always the link doesn't match the server: the public key, the short ID or the site name. Less often the server can't reach its masking site, or it isn't a Reality server at all.

Updated

On this page

What happens in a Reality handshake

A Reality client opens the connection like a browser visiting the masking site: the site's name goes into the sni, and a hidden tag goes into the handshake, made with the server's public key (pbk) and the short ID (sid). The server checks the tag with its private key. If it fits, the server answers with its own temporary certificate and the VPN starts. If not, the server quietly passes the connection on to the real website.

So to the client every mismatch looks the same: the real website's certificate came back instead of your server's. sing-box and the clients built on it (Hiddify, NekoBox and others) write reality verification failed; Xray-based clients such as v2rayN and v2rayNG write a REALITY line about a real certificate, and the connection breaks off.

On the server the same event leaves REALITY: processed invalid connection in the Xray log. A few such lines from unknown addresses are normal: scanners knock on every server and get the masking site, as intended. A line at each of your own attempts means your client is being turned away.

What you see, why, and what to do

  • reality verification failed at once, the address and port open

    Causepbk doesn't match the server's private key: the server got new keys, or the link is from another server

    What to doDerive the public key from the server's private key and compare it with pbk

  • The same after the server's settings were changed

    Causesid isn't in the server's shortIds

    What to doPut one of the shortIds into sid, or add yours on the server and restart Xray

  • The same, and the server's log shows a line at each attempt

    Causesni isn't in the server's serverNames

    What to doTake sni from serverNames exactly, with or without www. as written there

  • The client refuses the profile and asks for uTLS or a fingerprint

    CauseThe link has no fp

    What to doAdd fp=chrome to the link

  • EOF or a timeout for every client, even with a fresh link

    CauseThe server can't reach its masking site (dest)

    What to doRun xray tls ping for that site on the server; pick another site with TLS 1.3

  • Verification passes, then EOF; the server's log says invalid request user id

    CauseThe UUID in the link isn't among the server's clients

    What to doCompare the id before the @ in the link with the server's clients list

  • Verification passes, then the server drops the connection

    Causeflow differs: xtls-rprx-vision on one side only

    What to doSet the same flow in the link and in the server's client entry

  • reality verification failed with any link to this address

    CauseThe server isn't Reality: plain TLS, another program or another port

    What to doCheck security in the server's settings and that the link's port is Reality's

How to read a Reality link

The whole profile fits in one line:

Example
vless://9e2a4c1d-7b3f-4e8a-a1c5-2f6d8b0e3a71@203.0.113.5:443?encryption=none&flow=xtls-rprx-vision&security=reality&sni=www.example.com&fp=chrome&pbk=public-key&sid=6ba85179e30d4fc2&type=tcp#reality
  • The id before the @ — the UUID, the client's ID. It must be in the server's clients list.
  • security=reality — this is what makes the link Reality. With security=tls it is ordinary TLS, and pbk and sid are not used.
  • pbk — the server's public key, 43 characters. It is derived from the server's private key, and only from it.
  • sid — the short ID: up to 16 characters from 0–9 and a–f, an even number of them. It must be one of the server's shortIds; an empty sid works only if that list has an empty entry.
  • sni — the masking site's name, exactly as in the server's serverNames.
  • fp — the browser fingerprint the client imitates: chrome, firefox, safari and others. Reality needs one.
  • flow and type — usually xtls-rprx-vision and tcp. Both must be the same as on the server.

Check the server: the log and the keys

If the server is yours and Xray was installed with the official script, the settings are in /usr/local/etc/xray/config.json, in the realitySettings block: privateKey, shortIds, serverNames and dest.

On the server
journalctl -u xray -n 50 --no-pager

The last 50 lines of the Xray log. REALITY: processed invalid connection at each of your attempts — the client isn't recognized: compare pbk, sid and sni. invalid request user id — Reality passed, but the UUID is wrong. If your attempts leave no lines, set "log": { "loglevel": "info" } in config.json and restart Xray; afterwards set it back to warning.

On the server
xray x25519 -i "PRIVATE_KEY"

Put the privateKey from realitySettings in place of PRIVATE_KEY. The public key line it prints (Password (PublicKey) in current Xray, Public key in older versions) must equal pbk in the link character for character.

On the server
xray tls ping www.example.com

Checks the masking site from the server; the answer should show TLS 1.3. If it can't connect, the server doesn't reach the site: pick another and change both dest and serverNames, then the sni in every link.

On the server
xray run -test -config /usr/local/etc/xray/config.json

Checks the settings file without starting it. After any change: systemctl restart xray, one connection attempt, and the log again.

Less common causes

  • The link got damaged — a pbk missing one character or a line break inside the link gives the same error, and sing-box may write invalid public_key or invalid short_id. Copy it again, whole.
  • TLS fragmentation is on in the client — it breaks the Reality handshake. Turn it off for Reality profiles.
  • The server limits the time difference — with maxTimeDiff in realitySettings, a device whose clock is off by more than that is turned away. Turn on automatic time on the device.
  • The server limits client versions — minClientVer and maxClientVer turn away Xray clients that are too old or too new.
  • Another program holds port 443 — nginx or a panel answers instead of Xray. ss -tlnp | grep :443 shows who listens there.
  • The masking site changed — the server worked for months and then stopped: the site changed its TLS settings. Pick another site.

In Veli

Reality in Veli: one field, or the app sets up the server

In Veli a Reality link goes into one field: Profiles → Add, paste the vless:// link whole. The app works out that it is VLESS and takes pbk, sid, sni, fp and flow from the link, with nothing to fill in by hand. On a computer, Profiles then checks the server through the protocol itself, not just by ping: if the server turns the client away, the row shows “blocked”, and the tooltip says the address answers but no traffic goes through: a block or a wrong key.

If the server is yours, the app can set up Reality on it: Profiles → Add → “Your own server”, the server's address and password, then select VLESS Reality and install. The app makes the keys and the settings itself, so they can't drift apart from the link. The site to hide behind is picked nearest to the server, or you enter your own; at the end the server checks that the site opens from it as a masking site, and if it doesn't, the app says so and asks for another site. Each device gets its own link through “Add a device”.

FAQ

What does reality verification failed mean?

The client got the real masking site's certificate instead of your server's answer. The server didn't recognize the client and passed it on to the site; most often pbk, sid or sni in the link don't match the server.

What is REALITY: processed invalid connection in the Xray log?

A connection that didn't pass the Reality check and was sent on to the masking site. From unknown addresses that is normal: scanners probe every server. At each of your own attempts it means your link doesn't match the server.

How do I find the public key (pbk) of my Reality server?

On the server, run xray x25519 -i with the privateKey from the settings: the public key it prints is what goes into pbk. Without the private key the public one can't be found.

Can a wrong clock cause reality verification failed?

Only if the server limits the time difference with maxTimeDiff. A wrong clock is worth fixing anyway: it breaks ordinary TLS and VMess too.

A Reality server whose keys always match

Veli installs VLESS Reality on your server over SSH, makes the keys itself and gives each device its own link.