Cert check

443: non-443:

openssl s_client -showcerts -connect ${URL}:${PORT}

apt-get install -y bsdmainutils


Key exchange or key establishment any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm.

Diffie–Hellman key exchange (DH) is a method of securely exchanging cryptographic keys over a public channel and was one of the first public-key protocols The D–H key exchange protocol, however, does not by itself address authentication Google Chrome Intent to deprecate DHE-based cipher suites

Public key infrastructures (PKIs) have been proposed as a way around this problem of identity authentication.

  • registration authority (RA): assures valid and correct registration. In a Microsoft PKI, a RA is usually called a subordinate CA.

  • An entity must be uniquely identifiable within each certificate authority (CA) domain on the basis of information about that entity. A third-party validation authority (VA) can provide this entity information on behalf of the CA.

cipher or cypher

an algorithm for performing encryption or decryption

A stream cipher is a symmetric key cipher where plaintext digits are combined with a pseudorandom cipher digit stream (keystream).

Salsa20 is a stream cipher. Poly1305 is a cryptographic message authentication code (MAC),can be used to verify the data integrity and the authenticity of a message. In NaCl Poly1305 is used with Salsa20 instead of AES, in TLS and SSH it is used with ChaCha20 keystream.

"Networking and Cryptography library"/NaCl (pronounced "salt"): high-speed software library for network communication, encryption, decryption, signatures, etc

Libsodium: a portable, cross-compilable, installable, packageable, API-compatible version of NaCl. macOS, Linux, OpenBSD, NetBSD, FreeBSD, DragonflyBSD, Android, iOS, 32 and 64-bit Windows (Visual Studio, MinGW, C++ Builder), NativeClient, QNX, JavaScript, AIX, MINIX, Solaris

Cryptography libraries compare GnuTLS vs libsodium vs NaCL vs OpenSSL vs ...

X.509 X.509 is a standard that defines the format of public key certificates. used in many Internet protocols, including TLS/SSL, which is the basis for HTTPS contains a public key and an identity (a hostname, or an organization, or an individual)

Certificate Revocation List (or CRL)

"a list of digital certificates that have been revoked by the issuing Certificate Authority (CA) before their scheduled expiration date and should no longer be trusted."

TLS Extensions - Certificate Status Request Constrained clients may wish to use a certificate-status protocol such as Online Certificate Status Protocol - OCSP to check the validity of server certificates, in order to avoid transmission of CRLs and therefore save bandwidth on constrained networks. This extension allows for such information to be sent in the TLS handshake, saving roundtrips and resources.


Certificate formats

PEM Governed by RFCs can have a variety of extensions (.pem, .key, .cer, .cert, more) DER, a binary version of the base64-encoded PEM file. PKCS7 An open standard used by Java (E.g. Tomcat) and supported by Windows. Does not contain private key material. PKCS12, enhanced security versus the plain-text PEM format. can contain private key material.

certmgr.msc # Windows
openssl req -newkey rsa:2048 -nodes -keyout server.key -x509 -days 365 -out server.pem # Gen self-signed cert
openssl x509 -noout -text -in cerfile.cer/.pem/.crt [-inform pem/der] # Show Info
openssl x509 -out converted.pem -inform der -in to-convert.der # Convert
openssl pkcs12 -in file-to-convert..pkcs12/.pfx/.p12 -out converted-file.pem -nodes

ECDSA vs RSA with ECDSA you can get the same level of security as RSA but with smaller keys. legacy browsers may not support


Private Key private key is a text file used initially to generate a Certificate Signing Request (CSR), and later to secure and verify connections using the certificate created per that request. The private key is used to create a digital signature As you might imagine from the name.

Let's Encrypt

./certbot-auto certonly --webroot -w /usr/share/nginx/www/ -d -d
/etc/letsencrypt/live/ -> /etc/letsencrypt/archive/
cert.pem chain.pem fullchain.pem privkey.pem
-> cert1.pem chain1.pem fullchain1.pem privkey1.pem

Wildcard --issue -d -d '*' --dns dns_cf

certbot certonly --server \
--manual --preferred-challenges dns \
-d 'yourdomain.tld,*.yourdomain.tld'


PEM (.pem, .crt, .cer) to PFX

openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile more.crt

Mozilla SSL Configuration Generator

Apache / Nginx / Lighttpd / HAProxy / AWS ELB
Modern compatibility: IE 11 on Windows 7, Android 5.0
Intermediate compatibility (default): IE 7



listen 443 ssl http2;
listen [::]:443 ssl http2;
# certs sent to the client in SERVER HELLO are concatenated in ssl_certificate
ssl_certificate /path/to/signed_cert_plus_intermediates;
ssl_certificate_key /path/to/private_key;
ssl_session_timeout 1d; # default 5m
ssl_session_cache shared:SSL:50m; # *none = lie | off = reject | builtin[:size] = 1 worker| shared:name:size
ssl_session_tickets off; # default on. session resumption
# intermediate configuration. tweak to your needs.
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
# OCSP Stapling ---
# fetch OCSP records from URL in ssl_certificate and cache them
ssl_stapling on; # Default off. stapling of OCSP responses
resolver <IP DNS resolver>;
ssl_stapling_verify on; # Default off. verification of OCSP responses
## verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates;

Cloudflare (15-years wildcard)

SSL Modes Flexible: not encrypts traffic from Cloudflare to your origin server. Full: 3 options for certificates to install on your server: one issued by a CA (Strict), one issued by Cloudflare (Origin CA), or a self signed certificate.

Modern TLS: PCI 3.2 compliance requires either TLS 1.2 or 1.3 Opportunistic Encryption: for HTTP-only domains Data centers without access to private keys will experience a slight initial delay. HSTS forces clients to use secure connections for every request


Automatic HTTPS Rewrites safely eliminates mixed content issues by rewriting insecure URLs dynamically from known secure hosts to their secure counterpart.

Page Rules - Always Use HTTPS

Page Rules - Forwarding URL