From 0fa9e621d430642b554d9bd5e8c855de6f69af75 Mon Sep 17 00:00:00 2001 From: John Alden Date: Tue, 14 Nov 2023 16:55:01 -0700 Subject: [PATCH] force IPV4 on cygwin ssh-agent connections After upgrading to node18, our SSH connections from windows started failing and it was determined that the failure was caused by git-for-windows ssh-agent listeneing on the ipv4 loopback address while ssh2 was attempting to connect to the ipv6 loopback address and crashing as a result. Since this address comes from cygwin's unix domain socket emulation implementation, I'm not sure there's any way to change or influence its local address preference. --- lib/agent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/agent.js b/lib/agent.js index bb495d1b..8c0eca29 100644 --- a/lib/agent.js +++ b/lib/agent.js @@ -378,7 +378,7 @@ const CygwinAgent = (() => { sock.on('error', onFail); sock.on('end', onFail); sock.on('close', onFail); - sock.connect(port); + sock.connect(port, '127.0.0.1'); } }); }