Deployment guide

TLS handshake timeout: diagnosing the post-quantum ClientHello

Deploy on a VPS Cloud →

TLS handshake timeout: diagnosing the post-quantum ClientHello

Since late October 2026, tools such as `ollama pull` fail with `net/http: TLS handshake timeout` on hosts that still answer curl. The server is not down: recent clients announce a post-quantum key exchange by default, its first message is much larger, and a device on the path drops it. This guide explains the mechanism, gives two openssl commands that prove it in a few minutes, then sorts the fixes: repair the path first, and disable post-quantum for a single process only as a last resort.

10 min read16 steps
Contents· The symptom: curl answers, the tool times out1/12
  1. 01The symptom: curl answers, the tool times out
  2. 02Why a bigger ClientHello can block everything
  3. 03Symptom, likely cause and deciding test
  4. 04Diagnose in ten minutes
  5. 05Who blocks: remote server, middlebox or access path
  6. 06Fix it, or work around it
  7. 07Ollama on a VPS: the case in thread #19430
  8. 08What the GODEBUG=tlsmlkem=0 workaround costs
  9. 09Prove before working around
  10. 10Troubleshooting: the messages you will meet
  11. 11Keep the proof, not only the workaround
  12. 12Going further

The symptom: curl answers, the tool times out

The typical scenario fits in three lines. A download started by a tool written in Go stops on Error: pull model manifest: Get "https://registry.ollama.ai/...": net/http: TLS handshake timeout. The same host, queried with an older-generation curl, answers in a fraction of a second. And retrying changes nothing: three attempts out of three fail the same way.

This is the pattern of the ollama/ollama#19430 thread, opened on 31 October 2026. The point to keep is the asymmetry: the TCP connection is established, then the TLS handshake never completes. It is not a broken DNS record, a closed port or an expired certificate, which would produce different messages. When TCP works and only the first TLS message stays unanswered, look at the size and shape of that message, the ClientHello.

Why a bigger ClientHello can block everything

The ClientHello is the first message of a TLS connection: the client lists its algorithms there and sends its key exchange shares. Since Go 1.24, the standard library enables the hybrid post-quantum exchange X25519MLKEM768 by default when Config.CurvePreferences is nil. OpenSSL 3.5.0, released on 8 April 2025, does the same: its default group list puts X25519MLKEM768 first and sends two key shares, X25519MLKEM768 and X25519.

The ML-KEM share is large. In thread #19430 the post-quantum ClientHello weighs 1573 bytes, against 512 for the classical one: it no longer fits in a single packet. Yet some servers and devices assume the ClientHello arrives in one TCP read. The tldr.fail site describes this bug: the server reads the first fragment, judges the handshake invalid and hangs up, whereas a correct server would ignore the unknown option. The bug predates post-quantum, and size merely reveals it. The Go documentation presents it as the reason to use GODEBUG=tlsmlkem=0.

Symptom, likely cause and deciding test

Scroll the table

SymptomLikely causeDeciding test
Only the hybrid group times out with `openssl s_client`Post-quantum ClientHello filtered or misread`-groups X25519MLKEM768` then `-groups X25519`
curl passes with `--curves X25519:P-256`, the Go client times outThe Go client announces the hybrid group by default`GODEBUG=tlsmlkem=0` on that process only
Everything times out, even with X25519 aloneFirewall or routing: size is not the issue`curl -v` to another host and another port
Small requests pass, large exchanges freezeMTU or MSS, ICMP black hole`ping -M do -s 1472` then `tcp_mtu_probing`
One host fails, from all your networksServer that misreads a fragmented ClientHelloSame test from a second network
Failure on one network, success on anotherAccess filtering: ISP, company, middleboxSecond path: a VPS or a phone hotspot
Immediate cut (reset) after the ClientHelloDevice that hangs up on an unexpected message`tcpdump`: an RST right after the ClientHello

Diagnose in ten minutes

  1. Reproduce with curl

    Measure time and response code: curl -sS -o /dev/null -w '%{http_code} %{time_total}\n' https://example.com/. If curl answers fast and your tool times out, the server is reachable and the fault lies elsewhere.

  2. Force a classical ClientHello

    Run again with curl --curves X25519:P-256 -sS -o /dev/null -w '%{http_code} %{time_total}\n' https://example.com/. In thread #19430 this 512-byte ClientHello gets an answer in 0.32 s. Depending on the TLS library behind your curl, the option may be refused: read the message before concluding.

  3. Compare the two groups with openssl

    You need OpenSSL 3.5 or later for the first test. Run timeout 10 openssl s_client -connect example.com:443 -servername example.com -tls1_3 -groups X25519MLKEM768 </dev/null, then the same command with -groups X25519.

  4. Read the verdict

    If X25519 alone completes and the hybrid group stays silent until the timeout, the post-quantum ClientHello is too large or filtered. In the thread, the hybrid one times out after 8 seconds. If both fail, this is not that bug.

  5. Rule out the MTU

    Test ping -M do -s 1472 example.com: the 1500-byte packet without fragmentation must pass. Also read sysctl net.ipv4.tcp_mtu_probing: 0 disables detection, 1 enables it when an ICMP black hole is detected, 2 keeps it always on.

  6. Capture the exchange, optional

    With sudo tcpdump -ni any host HOST_IP and tcp port 443, look at what follows the ClientHello: retransmissions with no answer point to a dropped packet, an RST points to an active cut.

  7. Change network path

    Run the two openssl commands again from another connection: a mobile hotspot, or a VPS. Same result everywhere, the fault is on the remote host. Different result, it is on your access.

Who blocks: remote server, middlebox or access path

The test from a second network points at the culprit. If the host fails from everywhere, it is a server or a device in front of it: an old reverse proxy, an application firewall, a load balancer that misreads a fragmented ClientHello. You cannot fix that, but you can warn the operator by attaching the two openssl commands and their output, which saves the usual round trip.

If the host answers from one network and not from the other, the fault is on your access path: a corporate TLS inspection box, a firewall that does not recognise the hybrid group code, or filtering by an access provider. That is the case described in thread #19430, where the reporter is on an ISP that silently drops these ClientHellos. In that thread the block follows the destination IP address, not the SNI name, and the MTU test passes: the MTU lead was ruled out.

Fix it, or work around it

  1. Fix the path when it is yours

    Update the reverse proxy, firewall or inspection box that rejects the ClientHello. It is the only fix that keeps post-quantum.

  2. Handle the MTU if the test showed it

    If ping -M do -s 1472 fails, enable detection with sudo sysctl -w net.ipv4.tcp_mtu_probing=1, then persist the value in a file under /etc/sysctl.d/. It is a separate lead, to test after the hybrid group.

  3. Disable post-quantum for a Go client

    Run the command with GODEBUG=tlsmlkem=0, for example GODEBUG=tlsmlkem=0 ./my-tool. The client now announces only classical groups, and the ClientHello falls back to an ordinary size.

  4. Set it in a systemd service

    Create a drop-in with sudo systemctl edit my-service, add the line Environment="GODEBUG=tlsmlkem=0" under [Service], then sudo systemctl restart my-service.

  5. Set it in a container

    With Docker, add -e GODEBUG=tlsmlkem=0 to docker run. With Compose, add - GODEBUG=tlsmlkem=0 under environment: of the service concerned, then docker compose up -d.

  6. Remove the workaround once the path is repaired

    Note in your configuration repository why the variable is there. When the middlebox or server is fixed, delete it and repeat the openssl test to check that the hybrid group passes.

Ollama on a VPS: the case in thread #19430

The thread reports this behaviour with Ollama 0.40.13, in the official ollama/ollama:latest image under Docker, on an access provider connection with no VPN or proxy. The error is the one quoted above, on registry.ollama.ai. The reporter measured 1573 bytes for the post-quantum ClientHello, which times out, and 512 for the classical one, which gets a 404 answer in 0.32 s. With GODEBUG=tlsmlkem=0 on the process doing the download, three attempts out of three succeed, against three failures out of three without.

At the time of writing, this thread is open and mentions no official fix: the workaround is the reporter's, presented as temporary. For Ollama on a VPS the consequence is practical. If ollama pull times out while curl reaches the registry, apply the diagnosis above from the VPS, then set the variable on the ollama container, with docker run -e GODEBUG=tlsmlkem=0 ... or under environment: in Compose, and rerun docker exec ollama ollama pull the-model. A VPS also gives a network path different from yours: if it pulls the model without the variable, the filtering is on your access.

What the GODEBUG=tlsmlkem=0 workaround costs

  • No more post-quantum — the process no longer announces X25519MLKEM768: its connections lose the protection against traffic captured today and decrypted later.
  • A wide scope — the variable applies to the whole process, so to all its outgoing calls, not only to the host that causes trouble.
  • A temporary setting — it is a workaround, not a fix: it hides a network path defect that stays in place.
  • A debt to document — without a comment in the configuration, the variable survives for years and nobody knows why.
  • No universal guarantee — if the filtering does not come from the ClientHello, the variable changes nothing: repeat the openssl test to find out.

Prove before working around

Keep the output of the two openssl s_client commands (with and without the hybrid group), dated, in your ticket or in the message to the operator. It is enough to show that the host answers in classical and not in hybrid, and it avoids installing a workaround on a wrong diagnosis.

Troubleshooting: the messages you will meet

The same fault is displayed differently depending on the tool. Here are the most common forms, and what each says about the failure.

  • net/http: TLS handshake timeout — the Go client established TCP, then received no answer to its ClientHello. Run the openssl test with and without the hybrid group.
  • curl: (28) SSL connection timeout — the same symptom on the curl side: the handshake does not complete within the delay. Compare with --curves X25519:P-256.
  • timeout 10 openssl s_client ... with no output, return code 124 — the handshake did not complete in ten seconds. It is the expected result for a filtered hybrid group.
  • read: connection reset by peer — the other end or a device is actively cutting. Look for an RST right after the ClientHello with tcpdump.
  • connect:errno=110 in the openssl output — TCP itself times out, before any ClientHello: firewall or routing, not this bug.

Keep the proof, not only the workaround

A TLS handshake timeout that hits a single tool feels like a bug in the software. Comparing two groups with openssl puts the question back in the right order: does the host answer a classical ClientHello, and a hybrid one? Depending on the answer, the fix lies on the server, on the middlebox, on your access or, as a last resort, in an environment variable set on a process.

What is certain today: Go and OpenSSL announce the hybrid group by default, and some devices handle it badly. What is not: an official fix on the Ollama side, absent from the thread so far. Treat GODEBUG=tlsmlkem=0 as a dated patch, and repeat the test after every change to the path.

Going further

  1. Set up an Ollama server on a VPS

    Installation, models and API exposure: How to host Ollama on a VPS.

  2. Close repeated access attempts on this server

    To block attempts hitting the same service, see Fail2Ban Enhanced on a VPS.

  3. Choose the reverse proxy that terminates TLS

    Caddy, Traefik or Nginx Proxy Manager each handle TLS in their own way: the comparison.

Share this articleservorbit.com/ma-en/blog/tls-handshake-timeout-post-quantum-clienthello-diagnose