Sachin Chaurasiya

Toolbox · Networking

TLS Debugging

Inspect certificates, chains, protocols and ciphers; diagnose handshake failures and expiry.

Last reviewed
2026-09-18
On this page

Inspect a live endpoint

CommandPurpose
openssl s_client -connect host:443 -servername host < /dev/nullHandshake with SNI, print chain
openssl s_client -connect host:443 -servername host < /dev/null 2>/dev/null | openssl x509 -noout -dates -subject -issuerValidity and issuer
openssl s_client -connect host:443 -servername host -tls1_2 < /dev/nullForce a protocol version
openssl s_client -connect host:443 -servername host -showcerts < /dev/nullFull chain PEM
curl -vI https://host/ 2>&1 | grep -iE 'SSL connection|subject|issuer|expire'Quick summary via curl
nmap --script ssl-enum-ciphers -p 443 hostSupported protocols/ciphers

Inspect certificate files

CommandPurpose
openssl x509 -in cert.pem -noout -textEverything
openssl x509 -in cert.pem -noout -enddateExpiry
openssl x509 -in cert.pem -noout -ext subjectAltNameSANs
openssl verify -CAfile chain.pem cert.pemChain validation
openssl x509 -noout -modulus -in cert.pem | sha256sum; openssl rsa -noout -modulus -in key.pem | sha256sumKey matches cert
openssl pkcs12 -in bundle.p12 -info -nooutInspect PKCS#12

Kubernetes and cert-manager

CommandPurpose
kubectl get secret tls-web -o jsonpath='{.data.tls\.crt}' | base64 -d | openssl x509 -noout -datesExpiry of a TLS secret
kubectl get certificate,certificaterequest,order,challenge -Acert-manager pipeline
kubectl describe certificate web-tlsIssuance errors

Common failures

ErrorMeaningCheck
unable to get local issuer certificateMissing intermediate or untrusted CAServe the full chain; check -showcerts
certificate has expiredExpired leaf or intermediate-dates; renew; check clock skew with date -u
handshake failureNo shared protocol/cipher-tls1_2, ssl-enum-ciphers
hostname mismatchSAN does not include the host-ext subjectAltName
Cloudflare 525/526Origin handshake failed / invalid origin certOrigin must present a valid cert for Full (strict)

See also