| Error | Couldn't connect with these settings getConnection: Timed out while waiting for handshake |
|---|---|
| When | After 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 |
| Fix | n8n 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 |
| Reports | 3 people on GitHub, 24 Oct to 26 Nov 2026 (#42044, #45267); two against Salesforce Marketing Cloud SFTP |
| Checked | 5 Dec 2026, against the sources listed below |
Fix it
- 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 asreadyTimeout. - 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.
- Confirm it's the handshake, not the network: connect from the same machine with
ssh -vvv user@hostor 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 byssh2.
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
- npm install -g n8n: EBADPLATFORM (@napi-rs musl)
- n8n: Task request timed out (Code node not matched to a runner)
- n8n may have run out of memory while running this execution
Sources
Read 5 Dec 2026. These tools change often: if a step no longer matches, the linked page wins.
- n8n-io/n8n #42044 (2.44.6, Node 26, 8,192-bit DH group, timings; open): github.com/n8n-io/n8n/issues/42044
- n8n-io/n8n #45267 (n8n Cloud, Salesforce Marketing Cloud SFTP): github.com/n8n-io/n8n/issues/45267
- n8n PR #43787 (default timeout 10 s to 60 s; released 2.50.0): github.com/n8n-io/n8n/pull/43787
- n8n source: DEFAULT_CONNECTION_TIMEOUT and the Timeout option (Ftp.node.ts L113-L124): github.com/n8n-io/n8n/blob/c40524fb7299ab7c31d0d7546807fc8ead75f6b7/packages/nodes-base/nodes/Ftp/Ftp.node.ts#L113-L124
- n8n source: readyTimeout for SFTP connections (Ftp.node.ts L601-L640): github.com/n8n-io/n8n/blob/c40524fb7299ab7c31d0d7546807fc8ead75f6b7/packages/nodes-base/nodes/Ftp/Ftp.node.ts#L601-L640
- n8n release notes: 2.50.0: github.com/n8n-io/n8n/releases/tag/n8n%402.50.0
- n8n docs: FTP node: docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.ftp/
- Exposed API key checker: find API keys committed to a repo or shipped to the browser
- reviewready CLI: one command that checks an AI app repo before it ships