SadServers
  • Scenarios
  • Labs
    All Labs Linux & Bash Web Servers Databases Data Processing Docker Kubernetes CI/CD Infrastructure as Code Tooling / Applications
  • Dashboard
  • Solutions
    For Individuals For Businesses
  • Ranking
  • Newsletter
  • Documentation
    FAQ Support Pro Accounts Pro+ Accounts Business Accounts Gift API CLI/TUI Privacy Troubleshooting Interviews
  • Blog
  • Pricing
  • Gift
    Gift Purchase Gift Redeem
  • About
Log In - Sign Up
  1. Labs
  2. SSL
  3. Cheatsheet

Guide

Concepts and learning path

Troubleshooting

Failure modes and fixes

Cheatsheet

Commands to keep handy

SSL / TLS cheatsheet

openssl — test remote server

CommandDescription
openssl s_client -connect example.com:443 -servername example.comFull TLS handshake + cert (SNI)
openssl s_client -connect example.com:443 -showcertsShow full certificate chain
echo | openssl s_client -connect example.com:443 2>/dev/null | openssl x509 -noout -datesQuick expiry check
openssl s_client -connect example.com:443 -tls1_2Force TLS 1.2
openssl s_client -connect 127.0.0.1:443 -servername example.comTest local vhost via SNI

openssl — inspect certificates

CommandDescription
openssl x509 -in cert.pem -text -nooutHuman-readable cert details
openssl x509 -in cert.pem -noout -datesnotBefore / notAfter
openssl x509 -in cert.pem -noout -subject -issuerSubject and issuer
openssl x509 -in cert.pem -noout -ext subjectAltNameList SAN hostnames
openssl x509 -in cert.pem -noout -fingerprint -sha256SHA-256 fingerprint
openssl verify -CAfile chain.pem cert.pemVerify cert against CA chain
openssl x509 -noout -modulus -in cert.pem | openssl md5Cert modulus hash (match with key)

openssl — inspect private keys

CommandDescription
openssl rsa -in privkey.pem -check -nooutValidate RSA private key
openssl ec -in privkey.pem -check -nooutValidate EC private key
openssl rsa -noout -modulus -in privkey.pem | openssl md5Key modulus hash (must match cert)
openssl pkey -in privkey.pem -puboutDerive public key from private key

openssl — generate and CSR

CommandDescription
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodesSelf-signed cert (dev/test)
openssl req -new -newkey rsa:2048 -nodes -keyout key.pem -out csr.pemGenerate CSR for a CA
openssl req -in csr.pem -text -nooutInspect CSR contents

Certbot — Let's Encrypt (Linux)

CommandDescription
certbot certonly --nginx -d example.com -d www.example.comObtain cert (nginx plugin)
certbot certonly --webroot -w /var/www/html -d example.comHTTP-01 via webroot
certbot renew --dry-runTest renewal without applying
certbot renewRenew certs near expiry
certbot certificatesList managed certificates
ls /etc/letsencrypt/live/example.com/fullchain.pem, privkey.pem, cert.pem, chain.pem

cert-manager — Kubernetes

Command / resourceDescription
kubectl get certificate -AList Certificate resources
kubectl describe certificate my-tls -n mynsIssuance status and events
kubectl get certificaterequest,order,challenge -AACME challenge progress
ClusterIssuer / IssuerConfigures Let's Encrypt ACME account
Ingress annotation cert-manager.io/cluster-issuerAuto-provision TLS for ingress

Verify cert matches key

cert_md5=$(openssl x509 -noout -modulus -in fullchain.pem | openssl md5) key_md5=$(openssl rsa -noout -modulus -in privkey.pem | openssl md5) [ "$cert_md5" = "$key_md5" ] && echo "match" || echo "MISMATCH"

Pro tips

  • Always use -servername with openssl s_client when testing named vhosts
  • Serve fullchain.pem to clients — missing intermediates cause trust errors
  • Run certbot renew --dry-run after setup to confirm auto-renewal works
  • Check SANs, not just CN: openssl x509 -noout -ext subjectAltName -in cert.pem

Practice scenarios

Hands-on SSL scenarios on live Linux VMs: ssl

SadServersSadServers

Real-world Linux and DevOps scenarios for hands-on learning and technical assessment.

Uptime Robot ratio (30 days)
Product
  • Scenarios
  • For Individuals
  • For Businesses
  • Pricing
Resources
  • FAQ
  • Blog
  • Newsletter
Company
  • About Us
  • Support
  • Privacy Policy
  • Terms of Service
  • Contact
Connect With Us
info@sadservers.com

Made in Canada 🇨🇦
Updated: 2026-06-13 16:06 UTC – 2d2950a