Part 04 / Topic 3 of 6
DNS, TLS and certificates
When a request fails inside a customer's network, it fails in layers, and each layer has a distinctive error:
| Layer | Typical error text | What it means |
|---|---|---|
| DNS | Name or service not known / nodename nor servname provided |
The hostname does not resolve — wrong name, missing internal DNS, or no VPN |
| TCP | Connection refused / timed out |
Resolved, but nothing answers — firewall, wrong port, service down |
| TLS | certificate verify failed |
Connected, but the certificate chain is not trusted |
| HTTP | a status code | The request arrived; now it is an application conversation |
The TLS case has a corporate-network twist: many enterprises run TLS-inspecting proxies that re-sign traffic with a private certificate authority. Python then rejects the certificate even though the browser (which trusts the corporate CA) is happy. The fix is to point your client at the customer's CA bundle — httpx.Client(verify="/etc/ssl/acme-ca.pem") — never to switch verification off in production.
Done here? The practice set for Part 4 — 4 exercises with solutions — is on the part page.