Shipping an AI app or agent? Security review in 1 working day: $149 / ₹13,900. Request a review →
AI Review Ready
Home / Error fixes / SFTP: Timed out while waiting for handshake
Fix · n8n FTP node · SFTP

n8n SFTP: Timed out while waiting for handshake

Fix: update to n8n 2.50.0 or later, where the FTP node's default connection timeout went from 10 to 60 seconds, for the credential test too (PR #43787). If the handshake is slower still, set Options → Timeout (milliseconds) in the FTP node. The likely cause, from one reporter's analysis: the server picks an 8,192-bit Diffie-Hellman group, and generating the key took about 29 seconds on Node 26.

At a glance
ErrorCouldn't connect with these settings getConnection: Timed out while waiting for handshake
WhenAfter upgrades (2.33.3 to 2.44.6 in #42044) and on n8n Cloud; the same server works from OpenSSH, WinSCP and other clients
Cause (reporter's analysis)Node.js 24 to 26: generating the key for an 8,192-bit DH group-exchange took about 29 s, longer than the handshake timeout
Fixn8n 2.50.0: default 60,000 ms (was 10 s) for the node and the credential test; node option Timeout (ms)
Status#42044 is still open; no reporter has confirmed 2.50.0 fixes it yet
Reports3 people on GitHub, 24 Oct to 26 Nov 2026 (#42044, #45267); two against Salesforce Marketing Cloud SFTP
Checked5 Dec 2026, against the sources listed below

Fix it

  1. Update to n8n 2.50.0 or later. PR #43787 ("Allow slow SFTP handshakes by default", released in 2.50.0) raised the FTP node's default connection timeout from 10 to 60 seconds and applied the same default to SFTP credential tests, for password and private-key logins. In n8n's source the default is DEFAULT_CONNECTION_TIMEOUT = 60_000, passed to the SFTP client as readyTimeout.
  2. Raise it further if needed: FTP node → Options → Timeout, "Connection timeout in milliseconds". The credential test always uses the 60 s default, so a very slow server can still fail the test while the node works with a higher Timeout.
  3. Confirm it's the handshake, not the network: connect from the same machine with ssh -vvv user@host or WinSCP. In both reports, other clients connected fine, which rules out firewalls and IP allowlists.

Why it started after an upgrade

The reporter of #42044 compared the two images: the bundled ssh2 versions were the same, and the change was Node.js 24.18.0 to 26.12.1. Their server (Globalscape EFT) offered diffie-hellman-group-exchange-sha256; ssh2 asks for up to 8,192 bits, the server sent an 8,192-bit group, and on Node 26 generating the local key took about 29 seconds. Their debug timings:

1214  Received DH GEX Group
30500 Outbound: Sending KEXDH_GEX_INIT   <-- ~29 s generating the DH key locally

That's longer than the old timeout and shorter than the new 60 s default. The PR itself says its tests "model the reported handshake duration; they do not establish the cause of the key-exchange slowdown."

If you can't update

  • Self-hosted: an n8n team member asked the reporter to try the earlier version to confirm it still worked (#42044). The reporter's own workaround patched ssh2's maximum group size in a custom Docker image; that changes a library file and is undone by every update.
  • n8n Cloud: you can't change either. One Cloud user moved their pipeline from SFTP to the Salesforce Marketing Cloud REST API instead (#42044).
  • Server side: if you control the SFTP server, the analysis suggests the group-exchange size is what makes it slow; the fixed-size groups it also offered (diffie-hellman-group16-sha512, group14-sha256) were not chosen by ssh2.

Running Claude Code, Codex or Cursor on real repos, or shipping an AI agent? A Quick Review ($149 / ₹13,900, 1 working day) checks one repo, config or setup for leaked keys, risky agent permissions and MCP servers. Request a Quick Review

FAQ

How do I fix 'Timed out while waiting for handshake' in n8n SFTP?

Update to n8n 2.50.0 or later, which raised the default connection timeout to 60 seconds, and set a higher Timeout in the FTP node's options if the server is slower still.

Why did SFTP stop working after an n8n update?

One reporter traced it to Node.js 26: generating the key for an 8,192-bit Diffie-Hellman group took about 29 seconds, longer than the old timeout. The ssh2 library version had not changed.

Where is the Timeout setting?

In the FTP node under Options → Timeout, in milliseconds. The default is 60,000 from n8n 2.50.0.

Is it fixed for everyone?

Not confirmed. The fix shipped in 2.50.0, but #42044 is still open and no reporter has confirmed it on 2.50.0 yet.

Related errors

Sources

Read 5 Dec 2026. These tools change often: if a step no longer matches, the linked page wins.

Related free tools