`curl https://api.example.com` fails with `curl: (60) SSL certificate problem: unable to get local issuer certificate`.
IntermediateTroubleshootingNetworking, DNS and firewalls
Answer
Likely causes → The server doesn't send the intermediate certificate, the host's CA bundle is outdated, or a corporate TLS-inspecting proxy uses an internal CA not trusted by the host.
Diagnose →
openssl s_client -connect api.example.com:443 -servername api.example.com -showcerts </dev/null | grep -E 's:|i:'
rpm -q ca-certificates || dpkg -l ca-certificates
Fix → Fix the server's chain (send full chain). For an internal CA: copy it to /etc/pki/ca-trust/source/anchors/ and update-ca-trust (RHEL) or /usr/local/share/ca-certificates/ and update-ca-certificates (Debian). Never use curl -k as the fix.
Prevent → Keep ca-certificates updated; check chains in monitoring.
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