All notes

Networking

Tracing an HTTPS request

Separate DNS, TCP, TLS, and HTTP when a URL stops responding.

Start at the layer that failed

A browser’s error page compresses several very different failures into one screen. Check whether the name resolves, whether the destination accepts a TCP connection, whether TLS can verify the certificate, and whether the server returns the expected HTTP response. Record the first step that fails.

Keep the hostname when testing a specific address

Use curl --resolve when you want to select an address without changing DNS. The URL still supplies the hostname for TLS and HTTP. This example checks a local HTTPS listener for a domain you control. Replace the example name with the name on its certificate.

curl --resolve example.com:8443:127.0.0.1 \
  -sS -o /dev/null \
  -w 'HTTP %{http_code}, TLS verify %{ssl_verify_result}\n' \
  https://example.com:8443/

Check what came back

A successful handshake establishes which certificate the service presented. A 200 tells you a server answered. When verifying a release, check the response body too. Compare its title, a known heading, or a digest with the intended file.