Text of github.com › curl › curl › issues › 10144 as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout.

Open the live page

MITM program breaks socketpair, causes getaddrinfo() thread fail to start · Issue #10144 · curl/curl · GitHub

Skip to content You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert MITM program breaks socketpair, causes getaddrinfo() thread fail to start #10144 New issue Copy link New issue Copy link Closed Closed MITM program breaks socketpair, causes getaddrinfo() thread fail to start #10144 Copy link Labels Windows Windows-specific Windows-specific Description SerusDev opened on Dec 22, 2022 Issue body actions I did this curl https://www.google.com/ I expected the following Instead of a success, curl always returns: curl: (6) getaddrinfo() thread failed to start curl/libcurl version curl 7.83.1 (Windows) libcurl/7.83.1 Schannel Release-Date: 2022-05-13 Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp Features: AsynchDNS HSTS IPv6 Kerberos Largefile NTLM SPNEGO SSL SSPI UnixSockets operating system Windows 10 x64 possible cause I was able to trace this problem to https://github.com/curl/curl/blob/master/lib/socketpair.c#L126 Apparently, curl on Windows simulates unix socket pair with a pair of regular TCP sockets on 127.0.0.1.

If the system (like in my case) runs a program that works as a proxy for this connection, socket addresses (ports) mismatch and Curl_socketpair fails. I guess, the problem is widespread and cryptic. There is a number of antiviruses, firewalls, tunneling and monitoring software that proxy 127.0.0.1 connections and can cause this problem. At the same time, Curl_socketpair call does not provide any error messages. The top level getaddrinfo() error is very hard to track to this.

I experienced this problem when using git for Windows (curl based) together with Proxifier tool. I propose to remove a.inaddr.sin_port != a2.inaddr.sin_port condition or perform peer validation with a chunk of a random data transmitted over the socket (recv/send calls). Reacted by philinp Activity bagder added Windows Windows-specific Windows-specific on Dec 23, 2022 bagder commented on Dec 23, 2022 bagder on Dec 23, 2022 Member More actions You could of course also argue that Proxifier is the one breaking curl here...

Reacted by Christopher Nethercott, Marcus Müller and J. bagder changed the title [-] getaddrinfo() thread failed to start [/-] [+] MITM program breaks socketpair, causes getaddrinfo() thread fail to start [/+] on Dec 23, 2022 SerusDev commented on Dec 23, 2022 SerusDev on Dec 23, 2022 Author More actions You could of course also argue that Proxifier is the one breaking curl here... There is no program to blame. :) The problem is not Proxifier specific.

As you correctly stated any MITM tool including some antiviruses can cause this. The problem is that it is almost impossible to track the original error with the MITM tool. The fix for this is very easy. Socketpair code should not check the source port. Honestly, I do not see any security or stability issues here because everything happens within loopback IP. As far as I know, many other Windows programs (e.g., Firefox and VMWare) use the same loopback approach to emulate unix socketpair, but they do not check source port and work fine with a MITM program. bagder commented on Dec 23, 2022 bagder on Dec 23, 2022 Member More actions There is no program to blame. :) I disagree, but that doesn't help much.

Someone needs to adjust the code so that users can keep running intrusive programs that MITM localhost connections. bagder added help wanted on Dec 26, 2022 bagder added a commit that references this issue on Dec 27, 2022 socketpair: allow localhost MITM sniffers This issue will close once commit e760101 is merged into the 'master' branch. e760101 bagder removed help wanted on Dec 28, 2022 bagder closed this as completed in 7fa449c on Dec 28, 2022 drok added a commit that references this issue on Oct 15, 2025 socketpair: allow localhost MITM sniffers This issue will close once commit 7fa449c is merged into the 'master' branch.

7fa449c Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Metadata Metadata Assignees No one assigned Labels Windows Windows-specific Windows-specific Type No type Projects No projects Milestone No milestone Relationships None yet Development No branches or pull requests Issue actions You can’t perform that action at this time.