Networking & Firewall (Ss/Netstat/Iptables/Nftables/Curl)
Stop curl from silently failing when your API handshake dies
đź§© The Challenge
Everyone has dealt with a curl command that just hangs there forever while you wonder if the server is ignoring you or if the firewall is dropping packets into a black hole. It’s infuriating when you’re debugging a remote service and the connection just sits in a half-open state without giving you a hint as to why.
đź’ˇ The Fix
You need to tell curl to stop being so patient and force it to vomit up the connection details immediately. Adding the verbose flag combined with a strict timeout makes the failure loud and clear so you aren’t guessing.
curl -v --connect-timeout 5 --max-time 10 https://your-service.internal:port/endpoint
⚙️ Why It Works
By defining an explicit connection timeout, you prevent the tool from waiting on a zombie TCP handshake that will never complete. The verbose output then forces the underlying library to dump the request headers and handshake info, which usually highlights exactly which hop in the network is eating your traffic.
🚀 Pro-Tip: Toss in –trace-ascii – if you need to see the actual raw hex data flowing over the wire.
Linux Tips & Tricks | © ngelinux.com | 8/9/2026
