`ssh` and `curl` to a remote host work, but `git clone` over HTTPS hangs on large repos only.
AdvancedTroubleshootingNetworking, DNS and firewalls
Answer
Likely causes → A proxy or middlebox timing out long transfers, a broken HTTP proxy setting in git, or a stateful firewall killing long-lived connections.
Diagnose →
git config --show-origin --get-regexp 'http.*proxy'
env | grep -i proxy
GIT_TRACE=1 GIT_CURL_VERBOSE=1 git clone https://... 2>&1 | tail -40
Fix → Correct or remove proxy settings, set NO_PROXY for internal hosts, use shallow clones (--depth 1) or SSH transport, and raise idle timeouts on the middlebox.
Prevent → Central, documented proxy config (/etc/environment, systemd Environment=).
More on Networking, DNS and firewalls
`curl http://10.0.1.20:8080` returns `curl: (7) Failed to connect to 10.0.1.20 port 8080: Connection refused`.BeginnerThe same request instead hangs and ends with `curl: (28) Failed to connect to 10.0.1.20 port 8080 after 130000 ms: Connection timed out`. How is this different from "refused"?Beginner`ping google.com` fails with `ping: google.com: Temporary failure in name resolution`, but `ping 8.8.8.8` works.Beginner`dig api.internal` works, but the application and `curl` fail with `Could not resolve host: api.internal`.Intermediate`/etc/resolv.conf` changes you made disappear after a reboot or a few minutes.BeginnerDNS lookups take exactly 5 seconds before succeeding.Intermediate