Pcornel
Linux

Certificates & TLS

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

Back to the Topic

Answer

Certificates and TLS on Linux: X.509 certificates bind names to public keys and are signed by CAs; TLS uses them to authenticate servers (and sometimes clients). The system trust store decides which CAs are trusted.

Remember

Check name (SAN), validity dates, chain completeness and trust store. Different programs may use different trust stores (system, Java, Python certifi). Keep private keys readable only by their service.

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 s_client
Open a diagnostic TLS client connection and display handshake, certificate and protocol details.
openssl genpkey
openssl req -new
openssl x509 -checkend

Verify in this order

certificate issued → installed with chain and key → TLS handshake → client validates name, dates, chain and trust

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=2866

Confirmation

Confirm action

Continue?