Pcornel
Linux · Certificates & TLS

TLS Troubleshooting

Cheat sheet · https://pcornel.dk/topic.php?topic=2873

Back to the Topic

Answer

TLS troubleshooting finds why a handshake fails: name mismatch, expired certificate, incomplete chain, untrusted CA, protocol or cipher mismatch, SNI or client-certificate requirements.

Remember

Use openssl s_client with -servername and read the verify return code. Test the protocol with -tls1_2/-tls1_3. Check the client's clock and trust store.

First checks

  • openssl x509 -in <cert> -noout -subject -issuer -dates -ext subjectAltName — certificate details
  • openssl s_client -connect <host>:443 -servername <name> </dev/null — live chain and verification
  • openssl verify -CAfile <ca> -untrusted <chain> <cert> — chain validation
  • trust list | head / ls /etc/ssl/certs — system trust store

Commands

openssl x509 -in cert.pem -noout -subject -issuer -dates -ext subjectAltName
openssl x509 -noout -pubkey -in cert.pem
openssl pkey -pubout -in key.pem
openssl s_client -connect host:443 -tls1_2

Verify in this order

TCP → ClientHello (SNI, versions, ciphers) → server certificate → client validation → session

Where it usually breaks

First mismatch in identity/group resolution → Unix mode/ACL/capability → mount/sandbox constraint → SELinux/AppArmor policy → credential/TLS trust → protected operation; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2873

Confirmation

Confirm action

Continue?