1. What HTTPS adds
HTTPS is HTTP carried inside TLS. TLS provides encryption in transit, integrity protection and server authentication when certificate validation succeeds. It does not guarantee that the website itself is trustworthy or that data is safe after it reaches the server.
2. Inspect a certificate with OpenSSL
openssl s_client -connect example.com:443 -servername example.com -showcerts
The -servername option sends SNI so a server hosting multiple domains can select the correct certificate. Without it, you may see a default certificate unrelated to the requested hostname.
3. Check certificate dates and names
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \ | openssl x509 -noout -subject -issuer -dates -ext subjectAltName
Verify the hostname appears in the Subject Alternative Name extension and the certificate is within its validity period. Also verify the system clock is correct.
4. Test the HTTP layer
curl -Iv https://example.com/ curl --resolve example.com:443:203.0.113.10 -Iv https://example.com/
--resolve directs a specific hostname and port to a chosen IP while preserving the hostname for HTTP Host and TLS SNI. Use it to test a new origin before changing public DNS.
5. Common errors
| Error | Likely causes |
|---|---|
| Certificate name mismatch | Wrong certificate selected, missing SAN or wrong hostname. |
| Expired certificate | Renewal failure, wrong clock or stale certificate deployment. |
| Unknown issuer | Incomplete chain or untrusted CA store. |
| Connection refused | No listener, wrong IP/port or active reject. |
| Timeout | Routing, filtering, firewall or upstream availability. |
6. Renewal and operations
Use the certificate manager built into your web server or a dedicated ACME client. Monitor expiry, renewal logs and the certificate actually served from the public endpoint. Do not disable certificate verification as a “fix”.
openssl s_client -connect example.com:443 -servername example.com
curl -k as a permanent solution. It disables certificate verification and hides identity failures.Verification checklist
- Correct hostname and SNI.
- Valid date range and trusted chain.
- Expected certificate is served by the public endpoint.
- Application responds after TLS succeeds.
- Renewal is monitored before expiry.
References & further reading
Commands are examples for a representative Ubuntu/Linux environment. Review paths, versions, access requirements and maintenance impact before applying them to production systems.