OpenSSL notes: keys, certificate requests, checking certificates, your own CA and certificate bundles.

5 notes
Extract the Public Key from a Private Key with OpenSSL Extract and inspect the RSA public key that belongs to a private key with OpenSSL.Apr 15, 2016
How to Set Up Your Own CA with OpenSSL A guide (by Igor Soarez) to setting up your own certificate authority with OpenSSL.Jul 3, 2016
SSL Certificate Signing Request Best Practices Create a private key and CSR with OpenSSL using a request configuration file with SANs.May 4, 2016
SSL Checks OpenSSL commands to check CSRs, keys, certificates and PKCS#12 files, and whether a key and certificate match.Feb 8, 2016
SSL Rehash and File Permissions A script that builds certificate bundles, creates OpenSSL hash links and sets safe permissions.Mar 6, 2016
README.md PDF

📜 SSL / TLS certificates

My OpenSSL notes for everything around certificates.

I want to…Note
make a key and a certificate request (CSR) with SANsCSR best practices
check a CSR, key, certificate or .p12, and whether a key fits a certificateSSL checks
get the public key out of a private keyExtract the public key
run my own certificate authoritySet up your own CA with OpenSSL
build certificate bundles and hash links, with safe permissionsSSL rehash and file permissions

⚡ Quick reference

# when does the certificate of a website expire?
openssl s_client -connect tlnd.org:443 -servername tlnd.org </dev/null 2>/dev/null \
    | openssl x509 -noout -subject -issuer -dates
# what is in this certificate?
openssl x509 -in cert.pem -noout -text | less
# do this key and this certificate belong together? (the two hashes must be equal)
openssl pkey -in key.pem -pubout | sha256sum
openssl x509 -in cert.pem -pubkey -noout | sha256sum

🛠️ On GitHub

RepositoryWhat it is
check-SSL-expiry-in-daysbash-scriptA bash script that shows how many days a certificate is still valid, also for a whole list of domains
caddy_config_examplesCaddy v2 configuration examples (automatic HTTPS)
Cloudflare-ufw-rule-creatorAllow only Cloudflare’s IP ranges through UFW, for a site behind Cloudflare

🔗 Go deeper