back

Fix broken curl in OrbStack on macOS

This is a quick guide to fix the broken curl command in OrbStack on macOS.

Problem

OrbStack is a popular tool for running Linux machines on macOS, but a recent update has caused the curl command to break. When you try to use curl, you might see an error like this:

curl: (35) Send failure: Broken pipe

or a verbose error:

> curl https://google.com -v
* Host google.com:443 was resolved.
* IPv6: 2404:6800:4003:c03::66, 2404:6800:4003:c03::8a, 2404:6800:4003:c03::71, 2404:6800:4003:c03::64
* IPv4: 74.125.24.101, 74.125.24.138, 74.125.24.100, 74.125.24.102, 74.125.24.113, 74.125.24.139
*   Trying [2404:6800:4003:c03::66]:443...
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* Send failure: Broken pipe
* TLSv1.3 (OUT), TLS alert, decode error (562):
* TLS connect error: error:0A000126:SSL routines::unexpected eof while reading
* closing connection #0
curl: (35) Send failure: Broken pipe

This gets annoying as curl is a fundamental tool for many developers and system administrators. It’s especially used in installation scripts and all.

Solution

Took me a while to find this fix, I scoured the issue trackers and tried updating my machines so many times. Some suggested to remove OrbStack certificates, logout and reboot. That didn’t work for me.

So, after a long frustration I worked out the issue with Gemini and found out that it’s due to ipv6, I’m not sure if it’s just my network or some issue within the new OrbStack that breaks ipv6, but everything works again once I disable ipv6 in the machines.

So there you have it, disable ipv6 and it should work again.