An HTTPS request follows a strict order: the hostname resolves to an IP address, the client establishes a TCP connection to port 443, performs a TLS handshake, and only then sends an HTTP request. A CDN, load balancer, Nginx, and application may sit behind the public address. This guide works through the layers and defines the limits of each conclusion.
Record the initial symptom
Record the domain, exact URL, time and time zone, and the client network. Save the browser error text and the result from another external network. Clarify the scope: the entire domain or one path, with www or without it, IPv4 or IPv6, one region or several.
The first command-line request shows where the process stops:
curl -v --connect-timeout 10 --max-time 25 \
-o response.html https://example.com/problem-pathIn the output, find the resolved IP, whether a connection was established, TLS messages, and the HTTP status. Do not post cookies or authorization headers in a shared channel. If the request included secrets, make a safe copy without them.
Do not restart the proxy or application before collecting the initial data. A restart can change the process state, logs, and request routing. If you need a brief operational protocol before an in-depth diagnosis, use the incident response guide.
Step 1. Resolve the hostname using multiple DNS resolvers
Get the A and AAAA records using the system resolver and an independent public resolver:
dig +short A example.com
dig +short AAAA example.com
dig @1.1.1.1 +short A example.com
dig @1.1.1.1 +short AAAA example.comAn empty response, SERVFAIL, an old IP, or a discrepancy may point to the zone, delegation, DNSSEC, a cache, or an update that has not completed. A difference may be normal for a CDN; compare the addresses with the expected pool and point of presence region.
If both record types are published, test each path separately from here on. A working A record does not compensate for a faulty AAAA record for a client that prefers IPv6. Commands curl -4 and curl -6 show whether the symptom occurs with each protocol.
TTL affects how long discrepancies last, but does not guarantee the exact minute when all caches update. For details, see the article on DNS record propagation.
Result of this step: a list of the IPs actually received. This does not yet prove that the port is accessible or that the certificate is valid.
Step 2. Check TCP/443
Establish a connection to port 443 for each required path:
nc -vz -w 5 example.com 443Connection refused usually means the host is reachable, but the port is not listening or the connection is being actively refused. A timeout may indicate filtering, a routing problem, or an unavailable server. A successful connection confirms TCP connectivity from this location; the certificate and application have not yet been checked.
Repeat the test from another independent network. The combination “office — timeout, mobile network — success” points to a corporate firewall, provider, or route. If the error follows one IP from the DNS pool, investigate that specific edge or load balancer.
Do not move on to application logs until a connection to the public 443 is established. The request did not reach the HTTP handler, so there is no internal stack trace for it.
Step 3. Check the TLS handshake
After a successful TCP connection, retrieve the certificate chain with the correct SNI and hostname verification:
openssl s_client -connect example.com:443 \
-servername example.com -showcerts \
-verify_return_error -verify_hostname example.com </dev/nullThe parameter -servername sends SNI and selects the correct virtual host, while -verify_hostname separately checks the hostname against the certificate’s SAN. Compare the validity period, issuer, intermediate certificates, and verification result. A hostname error, expired certificate, and incomplete chain require different fixes. If the server drops the connection before presenting a certificate, there is not yet a basis for replacing the certificate file: a WAF, TLS terminator, protocol incompatibility, or route may be involved.
Check the nodes repeatedly if responses alternate. One server behind a load balancer may still be serving an old chain. A successful request by IP without SNI will reach a different virtual host and does not verify the user’s domain.
Common causes of browser messages are listed in the article about SSL certificate errors.
Step 4. Get an HTTP response over HTTPS
After TLS, send a regular GET request and save the headers and body:
curl -sS --connect-timeout 10 --max-time 25 \
-D headers.txt -o body.html \
-w '%{http_code} %{url_effective} %{time_total}\n' \
https://example.com/problem-pathGET is used intentionally. A CDN, WAF, or application may handle the HEAD request made by curl -I through a different route. If the previous test used HEAD, confirm its result with a GET request.
A 5xx status moves the investigation to the edge, proxy, application, or a dependency. 403 and 429 require checking access rules and rate limits. For a 3xx, follow the chain with -L and record the final domain. At 200, open body.html: an emergency fallback page can also return a successful status.
Check port 80 as a separate branch:
curl -sS -D - -o /dev/null --max-time 15 http://example.com/The expected 301 over HTTPS confirms that part of the unencrypted path is working, but does not identify the cause of the 443 failure. Traffic on the two ports may reach different components. Configuration for the redirect is described in the guide to redirecting HTTP to HTTPS.
Step 5. Identify the public edge
Find out where public TLS terminates: at a CDN, cloud load balancer, ingress, or Nginx. Compare the external certificate with the configuration of that component, and check its status and logs for the exact time of the error. A new file on the origin does not affect the chain if the certificate served to the client comes from the CDN.
For Nginx, first check the configuration using a read-only command, then inspect the error log and listening sockets. A successful syntax check confirms the configuration file; it does not confirm that the running process has loaded this version. Compare the PID, reload time, and public response.
The edge can complete TLS successfully and return 502 because the origin is unavailable. The reverse is also possible: the application works locally, but the public request is blocked by a WAF or route before reaching it.
Step 6. Compare the edge with the origin
Check the origin only through an authorized administrative path and without changing its state. For a local HTTP application, preserve the correct Host:
curl -sS -D - -o origin-body.html \
-H 'Host: example.com' http://127.0.0.1:3000/problem-pathFor direct HTTPS to a known IP, you can preserve the hostname and SNI using --resolve:
curl -sS -D - -o origin-body.html \
--resolve example.com:443:203.0.113.10 \
https://example.com/problem-pathDo not disable certificate verification in an evidentiary test. The option -k can show whether the server returns data when trust checks are ignored, but it does not confirm that the connection works correctly for the user.
A local 200 applies to one node and one virtual host. To confirm public recovery, check the path through DNS, the edge, and TLS. If the load balancer cannot reach the origin, investigate the CDN address allowlist, internal DNS, firewall, and health check. If responses from different backends alternate, compare the version and configuration of each one.
Summarize the results in a matrix
Each row corresponds to a network and IP. Fill it in with facts, not the words “works” and “does not work”:
| Point | IP | TCP/443 | TLS | HTTP GET | Result |
|---|---|---|---|---|---|
| Office IPv4 | 203.0.113.10 | success | hostname and chain are valid | 502 | Error after TLS |
| Mobile IPv6 | 2001:db8::10 | timeout | — | — | IPv6 route or filtering |
| Origin | 10.0.0.8 | success | internal path | 200 | Application responds on one node |
The temporary measure should match the layer identified: remove the faulty backend from service, roll back the TLS terminator configuration, or fix the confirmed DNS record. Save the logs and rollback method before making a change. Afterward, repeat the matrix rows using the same commands.
Daily SSL expiration monitoring helps detect an upcoming expiration in advance, but does not locate a current failure between the CDN and origin. An active incident still requires a completed matrix of public and internal paths.
Closure criteria
Check the original URL from several independent networks, over IPv4 and IPv6 if both records exist, and for the required domain variants. TCP must connect, TLS must pass hostname and trust verification, and GET must return the expected status and content.
In the incident record, include the completed matrix, confirmed cause, change made, and the times of several successful retries. Clearly mark any unverified route. For example: IPv4 подтверждён из двух сетей; IPv6 не проверен из-за отсутствия независимой точки. This wording specifies a concrete remaining task.