openvpn.is
English
简体中文繁體中文EnglishРусскийفارسی

HomeBlogError

Knocked for a minute, no answer

Why OpenVPN reports TLS key negotiation failed to occur within 60 seconds, and how to check ports, protocol, security groups, tls-crypt and blocked UDP.

Compiled on

The gate is shut; knocking longer will not help
The gate is shut; knocking longer will not help Clay Stranger, CC BY-SA 4.0

The message says one thing: within sixty seconds no usable answer came back to the packets you sent. It has nothing to do with your password.

OpenVPN connects in two steps: first a handshake in which both sides identify themselves and agree on keys, then the account and the address. This message stops at the very start of the first step: the other side did not answer, or answered something this side does not accept.

By likelihood

  1. The port is closedSystem firewall, cloud security group and router all have to allow it
  2. Different protocolsUDP on the server, TCP in the client, or the reverse
  3. Wrong addressThe name points to an old IP, or a digit of the port is missing
  4. Different keysIf tls-crypt or tls-auth differ, the server silently drops packets
  5. Service not runningCheck systemctl status
  6. UDP is blockedTry a phone hotspot
From the top down
A door knocker: knocking for 60 seconds with no answer is a TLS negotiation failure
A door knocker: knocking for 60 seconds with no answer is a TLS negotiation failure Bernard Gagnon, CC BY 4.0

Did the packets arrive

On the server
sudo tcpdump -ni any port 1194
You seeIt means
NothingThey did not arrive: firewall, security group, provider
Incoming onlyThe server ignores them, usually the tls-crypt key
Both waysReplies are lost on the way; check the client's firewall

With a wrong tls-crypt key the server deliberately stays silent, exactly like a closed port. That is why a capture saves the most time.

Only on one network

Offices, schools and hotels often allow only web ports. Open a TCP 443 entrance on the server and write two remote lines; the client tries them in turn.

A closed gate: usually a port, protocol or tls-crypt mismatch
A closed gate: usually a port, protocol or tls-crypt mismatch Keith Evans, CC BY-SA 2.0

Read the lines around it

Before it you seeIt means
TCP/UDP: Preserving recently used remote address, then nothingSent, no echo
TLS: Initial packet fromAn answer came; look at certificates or keys
cannot locate HMAC in incoming packetOne side has tls-auth or tls-crypt, the other not
Authenticate/Decrypt packet errorDifferent pre-shared keys
VERIFY ERRORCertificates, not the network
Connection refusedNobody listens on the port

If Initial packet is there and it still times out, large handshake packets are often lost. Try in the client:

Client profile
mssfix 1200

On the server, one by one

Server
sudo systemctl status openvpn-server@server
sudo ss -lnup | grep 1194
sudo journalctl -u openvpn-server@server -n 40

Active; listening on 0.0.0.0 or the public address and not only 127.0.0.1; and some trace of the client.

A server at home

Testing your own public address from inside often fails because routers do not loop back; use mobile data. Forward UDP, to a fixed internal address. If both the modem and the router translate addresses, both need forwarding. Without a public IPv4 no forwarding helps; use IPv6 or relay through a machine that has one.

A cloud server

Allow UDP 1194 inbound in the security group, then in the machine itself:

One of these
sudo ufw allow 1194/udp
sudo firewall-cmd --add-port=1194/udp --permanent && sudo firewall-cmd --reload

An example

At work nothing connects, at home everything does. A capture shows not one packet reaching the server; a phone hotspot works. The office blocks UDP. The cure is a second entrance on TCP 443 and a client that does not wait a minute:

Client profile
remote vpn.example.org 1194 udp
remote vpn.example.org 443 tcp-client
connect-timeout 8
connect-retry 2 10

When it is recognised

Some networks allow UDP but know OpenVPN's handshake: it connects for seconds once and then goes silent, and another port helps for minutes. tls-crypt encrypts the handshake as well and hides part of the pattern. Beyond that OpenVPN alone cannot go.

It works sometimes?

The server's UDP buffers are small or the line loses packets. Look for TLS errors in the server log at the same time.

Does changing the port help?

Sometimes. 1194 is well known and some networks block it.

Can sixty seconds be made longer?

hand-window 120 does, but if packets do not pass no time is enough.

Only the Android phone fails?

It may have only IPv6 while the server has only IPv4, or battery saving limits it.

Fine yesterday, nothing changed?

Public IP, certificate, domain, provider, in that order.

Walk on

Nearby gates

Signposts: TLS key negotiation failed, OpenVPN TLS handshake failed, OpenVPN connection timeout