Building the foundation of modern encryption on AlmaLinux: generating keys and CSRs with OpenSSL, distinguishing self-signed from CA-signed, managing the system trust store, automating Let's Encrypt certificates with certbot, and basic PKI understanding with OCSP and CRL.

In the previous episode, Episode 14, we secured remote access with SSH. Now we secure data in transit with TLS: the protocol protecting all HTTPS traffic on the internet. For modern servers, TLS certificates are no longer optional — without HTTPS, browsers mark sites as unsafe and many APIs refuse connections.
This episode takes you from OpenSSL basics, distinguishing certificate types, managing the system trust store, automating Let's Encrypt certificates, to understanding PKI concepts.
OpenSSL is the Linux standard cryptography toolkit. Digital certificates work with asymmetric cryptography: a private key (secret, stored on the server) and a public key (shared). A certificate is a document binding a public key to an identity, signed by a trusted authority.
The first step in creating a certificate: generate a private key, then create a CSR (Certificate Signing Request) — the formal request to a CA:
openssl ecparam -name prime256v1 -genkey -out domain.key
openssl req -new -key domain.key -out domain.csrThe example above uses the prime256v1 EC curve — modern and fast. During openssl req, you'll be asked for the organization name, Common Name (= the domain), and other details. To automate all the answers, use a configuration file:
[req]
distinguished_name = dn
prompt = no
[dn]
CN = example.com
[req_ext]
subjectAltName = DNS:example.com, DNS:www.example.comsubjectAltName (SAN) is the modern field that determines which domains a certificate protects — modern browsers ignore the Common Name and only read the SAN.
Self-signed means the certificate is signed by itself, not by a trusted CA:
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodesSuitable for labs and testing. Browsers will show a warning, since no CA can verify it — never use self-signed certificates for public production.
| Aspect | Self-Signed | CA-Signed |
|---|---|---|
| Signer | Itself | Certificate Authority |
| Client trust | Not automatic | Automatic via trust store |
| Use | Lab, testing | Public production |
| Cost | Free | Let's Encrypt free; commercial CAs paid |
CA-signed certificates come from a CSR sent to a CA — Let's Encrypt, or a commercial CA — which then returns a signed certificate.
Every system stores a list of trusted CAs. On AlmaLinux, this list is managed through the CA bundle in /etc/pki/ca-trust/ — and modified with update-ca-trust.
For a lab with its own CA (for example a company internal CA), add the CA certificate to the trust store:
sudo cp internal-ca.crt /etc/pki/ca-trust/source/anchors/
sudo update-ca-trustAfter that, all system tools — curl, wget, Python, Java — automatically trust certificates signed by that CA.
openssl x509 -in cert.pem -text -noout
openssl verify cert.pemopenssl verify checks the trust chain against the system trust store. If the output shows OK, the certificate chain is valid.
Let's Encrypt is a free CA that issues certificates with a 90-day validity, automated via certbot.
sudo dnf5 install -y certbot python3-certbot-nginxFor the Nginx web server:
sudo certbot --nginx -d example.com -d www.example.comCertbot detects the Nginx configuration, issues the certificate, and configures HTTPS automatically. For servers without a web server installed, use certonly mode:
sudo certbot certonly --standalone -d example.comSince Let's Encrypt certificates last only 90 days, automatic renewal is a must. Certbot provides a systemd timer:
sudo systemctl list-timers | grep certbot
sudo certbot renew --dry-runcertbot renew --dry-run tests the renewal process without actually renewing — a mandatory ritual to schedule periodically so renewal failures don't surprise you on day 90.
Info
If certbot is installed via dnf, the renewal timer is usually installed automatically. Always verify the timer exists, and run --dry-run after adding new domains. Episode 12 covers the systemd timer pattern in detail.
PKI (Public Key Infrastructure) is the complete ecosystem of CAs, certificates, and revocation mechanisms. Two revocation mechanisms worth knowing:
| Mechanism | How It Works |
|---|---|
| CRL (Certificate Revocation List) | A list of revoked certificates, updated periodically |
| OCSP (Online Certificate Status Protocol) | Real-time status check per certificate |
When a certificate's private key leaks, it must be revoked. Verify a certificate's OCSP status:
openssl ocsp -issuer ca.crt -cert server.crt -url http://ocsp.ca.exampleUnderstanding PKI lets you manage an internal CA — useful for labs, VPNs, and enterprise environments that need certificates for many internal services.
subjectAltName.--dry-run.update-ca-trust after adding a CA. Copying the file alone isn't enough; the new bundle only applies after that command.In this episode 15 you've built the encryption foundation: generating keys and CSRs with OpenSSL, the self-signed vs CA-signed difference, trust store management with update-ca-trust, Let's Encrypt certificate automation with certbot, and a PKI introduction with OCSP and CRL.
Key takeaways:
subjectAltName in every request.update-ca-trust after adding a CA to /etc/pki/ca-trust/source/anchors/.--dry-run.With encryption in place, you're ready to build comprehensive defense. In the next episode, Episode 16, we'll cover Security Compliance & Hardening — OpenSCAP and SCAP profiles, the CIS Benchmarks and STIG baselines, the lynis audit tool, AIDE integrity monitoring, and the ClamAV antivirus. See you there!