What Is a VPN Handshake?
The handshake is what happens in the moment between pressing connect and seeing the connected icon. This article lays out the stages, the round-trip cost, what observers can see and how to diagnose each kind of failure.
10 min readUpdated Oct 15, 2026By XPASS Editorial Team

Between the moment you tap connect and the moment the icon turns green, a short and carefully ordered conversation takes place. Your device and the VPN server say hello, agree on the rules, prove who they are, create fresh keys and check that both ends really have the same ones. That opening conversation is the VPN handshake, and it decides whether your tunnel starts at all.
Most of the time the handshake is invisible. It matters when something goes wrong, such as an app stuck on "connecting", an error that mentions authentication or timeouts, or a connection that works at home and fails in a hotel. This article walks through the stages in order, shows why the handshake costs a few round trips, explains what a watcher on the network can and cannot learn from it, and then turns the stages into a practical way of diagnosing failures. It does not cover the mathematics of key agreement, because that is a topic of its own; for the wider picture of what a protocol is, see what a VPN protocol is.
What a handshake has to achieve
Think of two people meeting for the first time at a front desk. Before any confidential business, they must confirm four things. A VPN handshake does the same.
- Agree on the rules. Which version of the protocol, which cipher and which options both sides support and will use.
- Prove identity. The client needs to be sure the server is the right one, and the server needs to know the client is allowed in.
- Create fresh keys. Both sides produce a new shared secret that no earlier session ever used.
- Confirm the result. Each side shows it has the same keys, usually by sending a small message that only the right keys can produce. If either side gets it wrong, the attempt stops.
Only once all four are done does the tunnel carry your data. If any one fails, you get a failed connection rather than a weaker one. This all-or-nothing behaviour is a feature: a tunnel that half-works would be worse than none.

The stages of a typical connection
Protocols differ in the details, so treat this as a general timeline. The names of the stages are ours, not an official standard.
Stage 0: Reaching the server. Before any VPN conversation, your packets have to arrive. Your device needs a working network, a way to look up the server's address and an open path to its port. If the network is a captive Wi-Fi that wants you to accept terms first, or a firewall that drops unfamiliar traffic, the process dies here and nothing in the VPN has even started.
Stage 1: Hello and negotiation. Your device sends a first message listing what it supports. The server answers with its choices. Both sides now know the protocol version and the algorithms in use.
Stage 2: Key agreement. Each side contributes fresh temporary values, and both compute the same shared secret without it ever travelling over the network. From this point, further handshake messages are usually encrypted.
Stage 3: Authentication. The server proves its identity, commonly with a certificate or a known public key. Depending on the setup, the client also proves itself with a certificate, a key or a username and password. If the clock on either side is badly wrong, certificate checks can fail here.
Stage 4: Configuration. Once both trust each other, the server tells the client what it needs to run the tunnel: the address to use inside the tunnel, which DNS servers to ask and which routes should go through it. Some protocols do this in the same exchange as authentication; others add a small extra step.
Stage 5: Confirmation and first data. Both sides check that the new keys work, then your packets start moving. A timer is started for later key renewal, and small keep-alive messages begin to flow so that routers along the path do not forget the connection.
A rough summary is that stages 1 to 3 build trust, and stages 4 and 5 make it useful.
Round trips: why the handshake takes time
A round trip is one message across the network and one reply back. The delay of a single round trip is determined by distance and congestion, and it can range from a few milliseconds on a good home link to a few hundred on a weak mobile connection. A handshake that needs several round trips takes several times that delay, however fast the computers are.
Here are typical figures to reason with.
| Design | Approximate round trips before data flows | Notes |
|---|---|---|
| Plain TCP connection | 1 | The three-way opening of TCP alone |
| TLS 1.3 on top of TCP | 1 more, so about 2 in total | Full handshake in one extra trip (RFC 8446) |
| Older TLS 1.2 on top of TCP | 2 more, so about 3 in total | One additional exchange compared with 1.3 |
| IKEv2 (IPsec) | 2 | An initial pair of messages, then an authentication pair (RFC 7296) |
| WireGuard | 1 | One initiation message and one response (WireGuard whitepaper) |
Now put numbers on it. Suppose the round-trip delay between your phone and the server is 200 milliseconds, which is plausible on a weak cellular link to a distant location.
- A design needing 1 round trip adds about 200 ms.
- A design needing 2 adds about 400 ms.
- A design needing 3 adds about 600 ms, and a username-and-password step inside the tunnel may add another round trip.
On a good broadband link with a 20 ms delay, the same handshakes finish in 20 to 80 ms, which you will never notice. This is why the same VPN can feel instant at home and take a couple of seconds on a train. You can read more about delay itself in Cloudflare's explanation of latency, and about the way it affects daily use in does a VPN reduce ping.
Handshake time is a one-off cost per connection. Once the tunnel is up, your everyday speed depends on other things, which why internet speed changes with a VPN explains.
What an observer can see during a handshake
People often ask whether the handshake itself is private. The honest answer is partly.
- Visible: that a connection attempt is made, the addresses and ports involved, the timing, and the size of the packets. A network operator can recognise the pattern of many VPN handshakes from these outward details.
- Visible in some designs: certain fields in the first messages, such as the protocol version or the list of supported algorithms. Newer designs encrypt more of the conversation as early as possible.
- Not visible: the shared secret, the session keys, your credentials when they are sent inside the protected part, and everything your apps send afterwards.
Practical consequences follow. Someone on your Wi-Fi can tell you opened a tunnel to a particular server, but not what you did inside it. That is also why changing a port number does not make a tunnel invisible. For more on what the people along the path can learn, read whether your ISP can see your VPN traffic.
When the handshake fails: symptoms by stage
The stage structure gives you a map for diagnosis. Error wording varies between apps and operating systems, so use the table to guess which stage failed rather than to match exact messages.
| Stage | What you may see | Likely causes | First thing to try |
|---|---|---|---|
| 0: Reaching the server | Stuck on "connecting", timeout, no reply | Network blocks the traffic, captive portal not completed, no internet at all | Open a web page; accept the Wi-Fi's terms; try mobile data |
| 1: Hello and negotiation | Failure straight after start; message about protocol or version | Outdated app, mismatched settings | Update the app; keep default settings |
| 2: Key agreement | Negotiation fails or times out after some replies arrive | Packets lost or too large for the path; unstable link | Switch networks; move closer to the router |
| 3: Authentication | Messages about certificate, trust or authentication | Wrong device date and time; wrong credentials; expired account | Fix the clock; recheck username and password |
| 4: Configuration | Connects, then shows no internet | DNS or routing information not applied | Reconnect; restart the app |
| 5: First data | Connected icon appears, nothing loads | Firewall or captive page interfering; keep-alive dropped | Test another site; reconnect |
Some phrases you might meet in logs are worth recognising, with the caveat that exact wording varies by software. A message saying that a key negotiation failed to complete within a set time, which in some OpenVPN setups is about a minute by default, points to stages 0 to 2: the opening packets never made the full journey. A message that authentication failed points to stage 3 and is almost always about credentials or an expired account rather than the network.
A step-by-step checklist for a stuck handshake
Work from the top, and stop when the connection succeeds.
- Confirm the network itself works. Open any ordinary web page without the VPN. If it does not load, or a login page appears, the problem is Stage 0. Complete the Wi-Fi login first.
- Check the device clock. Set date and time to automatic. A clock that is hours or days off can make certificate checks fail even when everything else is right.
- Retype the credentials. Copy them from your account page rather than from memory, and check for stray spaces. Remember that the sign-in details for a VPN app can differ from the login you use on a website.
- Check that the account or pass is active. An expired pass fails at authentication. Your account page shows the status.
- Switch the network. Try mobile data or another Wi-Fi. If it connects there, the first network is filtering something, and you can ask its operator whether VPN use is permitted.
- Update the app. Old versions may speak outdated variants of the protocol.
- Restart the app and the device. This clears half-open connections and stale network settings.
- Keep default settings. If the app offers protocol or port options, avoid changing several at once. Changing one setting at a time and noting the result keeps the experiment readable.
- Take the exact message to support. The message text and the time of the attempt help the provider look at the right part.
For the full set of fixes with more detail, use VPN not connecting? step-by-step fixes. If the tunnel comes up and then drops, how to reconnect when the VPN disconnects is the better place.

Rekey handshakes and why a connection may blip
Handshakes do not only occur at the start. Long-running tunnels renew their keys on a timer or after a certain amount of traffic by running a shorter handshake while data continues to flow. In most designs the old keys keep working until the new ones are ready, so you never notice.
Occasionally, though, a renewal falls at an unlucky moment, for example while the phone is switching from Wi-Fi to mobile data. The reply never arrives, the keys do not match, and the tunnel stalls until it detects the problem and starts again. The visible effect is a short freeze followed by recovery. If this happens regularly at about the same interval, it is a clue that something on your path, often a flaky Wi-Fi access point, drops packets at inconvenient moments. How to improve VPN connection stability lists remedies.
Scenarios
The cafe that never connects. Priya sits down, joins the cafe Wi-Fi and taps connect. The app is stuck on "connecting" for a minute and fails. She opens a browser without the VPN and is sent to a login page she never saw. Once she accepts the terms, the handshake completes at the next try. The cause was Stage 0, not the VPN.
The laptop with the wrong date. After a battery change, Kwame's old laptop forgets the time and resets to an earlier year. The VPN app reports a certificate problem. Setting the clock to automatic fixes it. The cause was Stage 3.
The train commuter. Mei Lin's tunnel takes two to three seconds to start in the carriage, yet is instant at her desk. The round-trip delay on her cellular link is high, and the handshake needs several trips. Nothing is broken. A tunnel that is already up when she boards, and a habit of not toggling it needlessly, avoids repeated setups.
The student who reconnects after sleep. After the laptop wakes, Jun sees the old tunnel is dead. The keys expired while the device slept. Reconnecting runs a fresh handshake and restores service in a moment.
Limits and misconceptions
- A handshake is not a speed test. Its duration is not a measure of how fast your connection will be afterwards.
- A successful handshake does not prove everything is safe. It shows that the tunnel is up. Check for leaks separately with how to check if your VPN is working.
- A failed handshake is rarely "hacking". It is far more often a clock, a typo or a restrictive network.
- Retrying hard does not help a filtered network. If a network consistently drops the opening packets, repeated attempts will not change it.
- Respect the rules of the network you are on. If a workplace or school prohibits VPN use, ask the administrators instead of experimenting.
Summary
A VPN handshake is the opening exchange in which your device and the server agree on the rules, authenticate each other, create fresh keys and confirm them before any of your data flows. It usually takes one to three round trips, so it is quick on a good link and noticeable on a slow one. Observers can see that it happens but not the keys or the contents. When it fails, the stage at which it stops, whether reaching the server, negotiation, key agreement, authentication or the first data, tells you where to look: the network, the clock, the credentials or the app. Work through the checklist, change one thing at a time, and take the exact message to support if it persists.
If you want to try these steps on your own devices, the download page links the free app and the pricing page shows how passes work.
Frequently asked questions
What is a VPN handshake in simple terms?
It is the short opening conversation between your device and the VPN server. They agree how to talk, prove who they are, create fresh keys and confirm that both sides have the same keys. Only after that does your real traffic start to flow.
How long does a VPN handshake take?
Usually a fraction of a second on a healthy connection. The time is mostly the number of round trips multiplied by the delay between you and the server, so it is longer on slow mobile links or far-away servers.
Why does my VPN get stuck on connecting?
The handshake did not finish. Common reasons are a network that drops the first packets, wrong credentials, a device clock that is far off, or a captive Wi-Fi login page that has not been completed.
Can anyone see my handshake?
Observers on the network can usually see that a handshake takes place, between which addresses and roughly when. They cannot read the keys or the traffic that follows. The exact visibility depends on the protocol.
Does a VPN do a handshake every time I reconnect?
Yes. Each new connection performs a fresh handshake, and long-running tunnels repeat a shorter one in the background to renew keys.
References
About the author

Bob Kanokphon Thongdee
- Founder of XPASS VPN
- Co-founder of eSIMonline.asia
- More than 7 years in online marketing
- Founder of Cojourney Visa and Cojourney Travel
Need a VPN for a short trip or a busy month?
XPASS sells prepaid passes for a set number of days. You pay once and nothing renews automatically.
See passesKeep reading

VPN Basics
What Is a VPN Protocol?
A VPN protocol sets the rules for how your device and a VPN server connect and protect traffic. Here is what that means in plain language, with the main trade-offs.
9 min read

VPN Security
What Is VPN Encryption?
VPN encryption scrambles your data between your device and the VPN server. Here is how keys, ciphers and the handshake work, and what encryption cannot do.
10 min read

Troubleshooting
VPN Not Connecting? Step-by-Step Fixes
A clear order of checks for when the VPN will not connect: pass status, login details, Wi-Fi and mobile data, permissions, firewalls, app conflicts and error messages.
8 min read

Troubleshooting
How to Reconnect When the VPN Disconnects
VPN connections drop sometimes. Here is a calm, ordered routine for getting back online safely and working out why it happened.
7 min read

VPN Security
WireGuard vs OpenVPN Explained
WireGuard and OpenVPN both build encrypted tunnels, but they differ in design, complexity and flexibility. Here is a plain comparison and how to think about the choice.
9 min read