Bookmarks

TLS and PKI

TLS and PKI: connection encryption and public key infrastructure. Covers the handshake, X.509, certificate chains, Let’s Encrypt and ACME, mTLS and openssl.

checked 6 Nov · next check 13 Nov · 59 min read

Sections
11
Reading
59 min
Languages
RU · UZ · EN
Written from
rfc-editor.org/rfc/rfc8446

Check status of the reference

Verified 6 Nov · next check 13 Nov

The sections were compared with the release notes, the check found nothing, and all source links respond.

  1. Verified
  2. Scheduled check

What TLS and PKI are and how they work

TLS is a protocol that protects a connection over an untrusted network: it encrypts data, detects tampering and uses a certificate to check that the server is who it claims to be. PKI, the public key infrastructure, is where that certificate comes from; without it, authentication does not work.

Websites and almost all protected traffic run on TLS: HTTPS is HTTP inside TLS, and mail, service-to-service traffic and client applications work the same way. Once you understand the handshake and certificates, it is much quicker to find the cause when a connection drops with a cryptic error.

What TLS protects

Once the handshake is done, a connection gives you three properties: confidentiality, because only the two endpoints can see the data; integrity, because tampering with records is detected; and authentication, because the server proves its name with a certificate and, with mutual authentication (mTLS), the client proves its own.

TLS does not know what it protects: HTTP, SMTP, IMAP and other application protocols run inside it. All it needs from the transport is a reliable byte stream, usually TCP. QUIC, the transport for HTTP/3, combines transport and TLS 1.3 in one protocol over UDP, so for HTTP/3 TLS runs inside QUIC.

The diagram below shows where TLS sits in the stack and how it is built: the handshake negotiates keys and checks the certificate, while the record protocol splits data into records and encrypts each one with its own keys.

The layers of a TLS stack, and the QUIC path without a separate TLS layer.

SSL is the old name of the protocol. SSL 2, SSL 3 and the first TLS versions, 1.0 and 1.1, are prohibited by current standards, so calling TLS “SSL” confuses it with protocols that must not be enabled. The current versions are TLS 1.3 and, for compatibility, TLS 1.2.

What PKI is

PKI (public key infrastructure) answers the question of why a client trusts a server it has never seen. The server presents an X.509 certificate, a document in which a certificate authority (CA) has signed the link between a site name and a public key. The client verifies the signature along the chain up to a root certificate in its trust store, and so confirms that the key really belongs to that name.

In the PKI model from RFC 5280, the participants are the certificate holder, the certificate authority, which signs certificates and tracks their revocation, and the repository they are fetched from. On the internet, the server itself hands out certificates during the handshake, and Certificate Transparency logs record what public CAs issue; the full circle of trust is covered in “Certificate chains”.

A public CA such as Let’s Encrypt issues a certificate after domain validation, and issuance and renewal are automated by the ACME protocol, covered in “ACME and Let’s Encrypt”. Inside a company, you can run your own CA for services and client certificates.

How TLS 1.3 differs from TLS 1.2

TLS 1.3 is the current version of the protocol: the handshake is shorter, obsolete cryptography is removed and almost the whole handshake is encrypted. TLS 1.2 is still supported for older clients, but configuring it securely is manual work (see “Security: recommended configuration”).

FeatureTLS 1.3TLS 1.2
Handshakeone round trip before datatwo round trips
Key exchangeephemeral groups or PSKdetermined by the cipher suite
Cipher suitesfixed list of AEAD suitesconfigurable, including obsolete ones
Forward secrecyalways, except PSK without (EC)DHEwith (EC)DHE suites
What is encryptedeverything after ServerHelloapplication data; key messages are in the clear
Statusthe main versionsupported, frozen

Forward secrecy is a property of key exchange: if the server’s long-term key leaks, past records still cannot be decrypted, because the session key is derived from ephemeral shares and then erased. In TLS 1.2 it comes with (EC)DHE suites. In TLS 1.3, (EC)DHE exchange is built into the handshake, and the only exception is PSK mode without (EC)DHE, which has no forward secrecy (RFC 9846, section 2.2).

What you need to know first

  • TCP and ports: TLS runs over a reliable TCP stream, usually on port 443; see the TCP/IP and DNS reference.
  • DNS: the server name ends up in the certificate and in name verification; see the TCP/IP and DNS reference.
  • Cryptography at the level of concepts: public and private keys, signatures and hashes, in plain words and without the maths.

Where to go next

The handshake, message by message, is in “The TLS 1.3 and 1.2 handshakes”, the structure of a certificate is in “X.509 certificates”, and issuance and renewal are in “ACME and Let’s Encrypt”. The openssl commands for checking are collected in the cheat sheet.

Section sources

the section is written from these pages

Cheat sheet: ports and openssl commands

A TLS cheat sheet: the ports of TLS services, the status of protocol versions, handshake alerts and openssl commands for checking connections and certificates. Replace the names in the examples (example.com, cert.pem) with your own.

Ports

PortWhat listens
443HTTPS: HTTP inside TLS; the default port for the https scheme
465mail submission (submissions): TLS handshake straight after connecting
587mail submission (submission): SMTP first, then STARTTLS
25mail transfer between servers: STARTTLS by agreement
993IMAP mail (imaps): TLS handshake straight after connecting
853DNS over TLS (DoT): TLS handshake straight after connecting

Protocol versions

New configurations set TLSv1.3 and TLSv1.2; TLS 1.1 and 1.0 cannot be negotiated, and new protocols are built on TLS 1.3 only. For help choosing, see “Security: recommended configuration”; for the history of versions, see “Standards and their status”.

ValueStatus
TLSv1.3current version of the protocol
TLSv1.2current, gets no new features
TLSv1.1not in use: negotiation is prohibited
TLSv1.0not in use: negotiation is prohibited
SSLv3not in use: removed from modern implementations

Handshake alerts

When a handshake fails, the client and server exchange alerts: short codes with an explanation. The name of the alert tells you what to fix; for a full walkthrough, see “Common errors and troubleshooting”.

ValueWhat it means
handshake_failureno common cipher suite, group or signature algorithm was found
bad_certificatethe certificate is corrupt or its signature does not verify
certificate_expiredthe certificate has expired or is not yet valid
unknown_cathe chain was built, but the root is not in the trust store
protocol_versionthe requested protocol version was recognised but is not supported

Inspect a connection

bashOn the host
openssl s_client -connect example.com:443 \  -servername example.com

After the handshake, s_client prints the protocol and cipher suite, the server certificate and the verification verdict on the Verify return code line. The connection stays open, so you can type an HTTP request by hand; to quit, enter Q at the start of a line.

TaskAdd to s_client
Show the whole chain sent by the server-showcerts
Force TLS 1.3-tls1_3
Summary only: protocol, cipher, verdict-brief
Server where TLS starts after STARTTLS-starttls smtp
Show handshake messages-msg
Treat a verification error as fatal-verify_return_error

Certificates: inspect

TaskCommand
Certificate fieldsopenssl x509 -in cert.pem -noout -text
Validity periodopenssl x509 -in cert.pem -noout -dates
Names in the SANopenssl x509 -in cert.pem -noout -ext subjectAltName
Just the subject, issuer and serial numberopenssl x509 -in cert.pem -noout -subject -issuer -serial
SHA-256 fingerprintopenssl x509 -in cert.pem -noout -fingerprint -sha256
Does the certificate expire within the next 24 hoursopenssl x509 -in cert.pem -checkend 86400
Which name the certificate coversopenssl x509 -in cert.pem -noout -checkhost example.com

Certificates: verify and create

To verify against your own trust store, put the intermediate certificates in chain.pem and the root certificate you trust in ca.pem.

bashOn the host
openssl verify -CAfile ca.pem \  -untrusted chain.pem cert.pem

A certificate signing request (CSR) is created together with a new private key: one command writes both key.pem and req.pem. The site name goes into the CN field, and additional names go into the SAN (Subject Alternative Name) extension.

bashOn the host
openssl req -new -newkey rsa:2048 -noenc \  -keyout key.pem -out req.pem \  -subj "/CN=example.com" \  -addext "subjectAltName=DNS:example.com,\DNS:www.example.com"

To inspect a request, use the same command with the -verify flag: it prints the fields and checks the request’s self-signature. req.pem has no validity period and no force until a certificate authority signs it: you send it to the CA or to an ACME client (see “ACME and Let’s Encrypt”).

bashOn the host
openssl req -in req.pem -noout -text -verify

Further reading

The handshake, message by message, is in “The TLS 1.3 and 1.2 handshakes”; certificate fields are in “X.509 certificates”; building a chain and verifying the root are in “Certificate chains”.

Section sources

the section is written from these pages

The TLS 1.3 and 1.2 handshakes

The handshake is the initial series of TLS messages in which the client and server agree on a version and cipher suites, exchange keys and verify each other with certificates. In TLS 1.3 it takes one client–server round trip, and both sides are already encrypting traffic after the second message.

The difference between the versions is fundamental: TLS 1.3 encrypts almost the whole handshake and always provides forward secrecy (except in PSK mode without a key exchange), whereas in TLS 1.2 the first messages travel in plain text. The step-by-step description is in the protocol overview of RFC 9846, and the TLS 1.2 sequence is in RFC 5246.

Curly braces mean encryption from this step on.
  1. The client sends ClientHello with a list of versions and cipher suites and its own key shares in the key_share extension. They are computed in advance, so there is no need to wait for them.
  2. The server picks the parameters and replies with ServerHello, which carries its own key_share in the same group. From the pair of shares, both sides derive the same secrets, and from then on records are encrypted.
  3. The server sends the already encrypted EncryptedExtensions, Certificate, CertificateVerify and Finished; the client verifies the chain and the signature.
  4. The client replies with its own {Finished}.
  5. After the server’s reply, both sides exchange application data.

The Finished message is a message authentication code (MAC) over all the handshake messages the sender has sent and received so far. It proves that both sides derived the same keys and that nobody tampered with the exchange on the way.

Extensions decide what happens next: server_name (SNI) carries the site name that the server uses to choose a certificate, and application_layer_protocol_negotiation (ALPN) names the protocol to run over TLS, such as h2 or http/1.1. The client sends all of this before encryption starts, so it is visible on the way to the server.

After the server’s Finished, the server can already send application data, even though the client has not yet proved who it is; without a client certificate, the server does not learn this anyway. The client sends its own Finished straight afterwards, so in normal operation this gap goes unnoticed.

Session resumption and 0-RTT

After a full handshake, the server gives the client a resumption key (PSK) in a NewSessionTicket message. For the next connection, the client opens with a ClientHello that carries this key and a psk_binder, a key-verification code tied to the new handshake; the server replies with its own {Finished}, and the connection is ready one round trip sooner.

With this key, TLS 1.3 allows data to be sent with the very first message, in a mode called 0-RTT (early data). The price of the speedup is that the server must accept such data before verifying Finished, and the protocol cannot tell a replayed record from a new connection. An attacker can replay a captured first flight, for example a request to make a transfer. Enable 0-RTT only for requests where a replay is harmless, such as methods that do not change state on the server.

Encrypted Client Hello

ECH (Encrypted Client Hello, RFC 9849) encrypts the ClientHello itself. The client builds a public ClientHelloOuter with harmless fields and a nested, encrypted ClientHelloInner with the real SNI and ALPN. The server publishes the public key for encryption in advance, in an HTTPS DNS record. It works in TLS 1.3 and later; a server that does not recognise ECH continues the handshake using ClientHelloOuter.

ECH hides the site name and the ALPN list from anyone listening on the path. DNS queries and the server address stay exposed; they are covered by encrypted DNS and by hosting several sites on one address.

The TLS 1.2 handshake

In TLS 1.2, the key messages travel in plain text and there is one more exchange: after ServerHello, the server sends Certificate, ServerKeyExchange, CertificateRequest if it wants to verify the client, and ServerHelloDone. The client replies with ClientKeyExchange, ChangeCipherSpec and Finished, and with a client certificate, Certificate and CertificateVerify as well. The ChangeCipherSpec message announces that the following records are protected with the new keys.

The choice of cipher suites determines where the session key comes from. ECDHE suites provide forward secrecy: the session key is derived from ephemeral Diffie–Hellman shares, so a leak of the server’s long-term key does not expose old connections. Static exchanges lack this guarantee: RFC 10015 classes TLS 1.2 suites with RSA and finite-field exchange as deprecated, and RFC 9852 requires TLS 1.3 for new protocols. Enable only ECDHE suites (see “Security: recommended configuration”).

StepTLS 1.3TLS 1.2
Parameter negotiationClientHello + ServerHellothe same
Key exchangekey_share inside ClientHello and ServerHelloseparate ServerKeyExchange and ClientKeyExchange messages
Encryption startsafter ServerHelloafter ChangeCipherSpec
Certificate and signaturein encrypted messagesin plain text
Round trips for a full handshake12

How to see the handshake

The easiest way to examine the exchange is the openssl s_client client: the -msg flag prints the handshake messages as they pass. You can see the order of the messages and the moment encryption switches on right in the output.

bashOn the host
openssl s_client -connect example.com:443 \  -servername example.com -msg

The output shows ClientHello with the key_share and server_name extensions, then ServerHello, EncryptedExtensions, Certificate, CertificateVerify and Finished. What the Verify return code line means, the verdict of the chain check, is explained in “Certificate chains”.

Section sources

the section is written from these pages

X.509 certificates

An X.509 certificate is a document signed by a certificate authority (CA) that binds a site’s names to the server’s public key. During the TLS handshake, the server presents it to the client, and the client checks the site name, the validity period and the CA’s signature. Inside are fields and extensions, from the serial number to subjectAltName with the site’s names.

The format is defined by the RFC 5280 profile. The inner part is the block of signed data (tbsCertificate) with the issuer, validity period, subject, public key and extensions; the outer part is the signature algorithm and the issuer’s signature itself.

The exact field values are printed by openssl x509 -text.

Fields the client reads

The subject is the distinguished name (DN) of the holder: CN=example.com, O=Example Org. The issuer is the same kind of name for whoever signed the certificate. The pair of issuer and serial number identifies a certificate uniquely: the CA assigns the number, and one issuer never repeats it.

The validity period is two points in time: notBefore, before which the certificate is not yet valid, and notAfter, after which it is no longer valid. The client compares the current time with both ends of the period.

The public key sits in subjectPublicKeyInfo together with its algorithm: RSA, ECDSA or Ed25519. A certificate does not contain the private key and cannot: it stays on the server in a separate .key file.

An extension is a record of an identifier, a value and a critical flag. A certificate with an unknown critical extension is unusable: the client must reject it. This is why only things that cannot be misinterpreted are marked critical.

Extensions: name, purpose, limits

Subject Alternative Name (SAN) is an extension listing the names the key is bound to: DNS entries, IP addresses and email addresses. Domain names live only here, because the client does not check the CN field. If the subject has no name at all, SAN is mandatory and is marked critical.

Key Usage limits what the key may be used for: the bits digitalSignature, keyEncipherment, keyAgreement and others. Extended Key Usage (EKU) adds purposes: serverAuth for authenticating a TLS server and clientAuth for a client. Basic Constraints says whether the certificate belongs to a CA: the CA:TRUE flag permits signing other certificates, while CA:FALSE or no extension does not. Key identifiers hold key fingerprints: subjectKeyIdentifier for the certificate’s own key and authorityKeyIdentifier for the signer’s key.

ExtensionWhat it sets
subjectAltNamethe site’s names: DNS, IP, email; these are what the client checks
keyUsagekey operations: signing, key encipherment, key agreement
extendedKeyUsagepurposes: serverAuth, clientAuth
basicConstraintsthe CA:TRUE/CA:FALSE flag and the maximum chain depth
subjectKeyIdentifier, authorityKeyIdentifierkey fingerprints: the certificate’s own and the signer’s

How the client matches the name

The client takes the name from the address and looks for it among the SAN entries: a domain by an exact, case-insensitive comparison, an IP address byte by byte. An asterisk * stands for the whole leftmost label: *.example.com covers shop.example.com, but not a.b.example.com and not example.com itself.

The client does not check the site name in the CN field, as RFC 9525 established: names live in the SAN, and the CN is only a note for humans. If no SAN entry matches, the connection is aborted with a certificate warning.

Name in the addressSAN *.example.comSAN example.com
example.comnoyes
www.example.comyesno
shop.example.comyesno
a.b.example.comno: two labelsno
bashOn the host
openssl x509 -in cert.pem -noout -checkhost www.example.com

Key, request and issuance

The pair is born with the owner: the private key is written to a .key file and never leaves the server, and the public key goes into a certificate signing request (CSR), a signed PKCS#10 form with the name, the public key and the SAN you want. The CA checks the data, signs it and returns a certificate. A CSR has no validity period: its only force is the owner’s signature.

bashOn the host
openssl req -new -newkey rsa:2048 -noenc \  -keyout example.com.key -out example.com.csr \  -subj "/CN=example.com" \  -addext "subjectAltName=DNS:example.com, \DNS:www.example.com"

The -noenc flag leaves the key without a passphrase, which is what a web server needs to read it; for a key with a passphrase, the server also needs the passphrase itself (in nginx, the ssl_password_file directive). The name and SAN are set with flags, as above, or you can keep them in a configuration file. Issuance from a public CA is automated by ACME; see “ACME and Let’s Encrypt”.

File formats

DER is the binary form of a certificate; PEM is the same structure in base64 between the lines -----BEGIN CERTIFICATE----- and -----END CERTIFICATE-----. Modern openssl detects the format on its own. File extensions say nothing about the content: .crt and .pem are usually a certificate, .key is a private key and .csr is a request.

PKCS#12 (.p12 and .pfx files) is a container that holds the certificate, chain and key in one password-protected file; this is how certificates are moved to Windows and to client devices.

FileWhat is insideWhere it is used
.pem, .crt, .cera certificate or chain, as PEM textservers, inspection
.derthe same, as a binary filerarely: Windows, devices
.keya private key, with or without a passphraseservers; permissions 600
.csran issuance request (PKCS#10)sent to the CA
.p12, .pfxa certificate with its key under a passphrasetransfer, Windows, clients

Validation type and validity period

The validation type defines what the CA confirmed before issuing: with DV (domain validation), control of the domain; with OV (organisation validation), the organisation’s details as well; with EV (extended validation), the organisation under the strictest rules. Let’s Encrypt issues DV only: OV and EV cannot be automated.

The validity period is a compromise: the shorter it is, the smaller the window for a stolen key or a mistaken issuance, but the more important automated renewal becomes. Let’s Encrypt certificates last 90 days, and the maximum will shrink to 45 days by February 2028; industry rules will limit certificates to 47 days from 15 March 2029. Renewal is handled by the ACME client; see “ACME and Let’s Encrypt”.

Further reading

How a certificate appears in the handshake is covered in “The TLS 1.3 and 1.2 handshakes”, verification of the signature and root in “Certificate chains”, and revocation before expiry in “Certificate revocation”.

Section sources

the section is written from these pages

Chains of trust

A chain of trust is the path from a site’s certificate to a root certificate the client already trusts: the root sits in its trust store. The client checks signatures along the chain from the bottom up, which is why the server sends not only its own certificate but the intermediates too.

There are usually three levels. The leaf certificate is issued for the site by an intermediate certificate authority (intermediate CA), which is in turn issued by a root CA. The root signs itself: trust in it comes not from a signature but from OS, browser and runtime vendors having preinstalled it in their stores. Their lists differ and are updated independently, so the same chain does not validate on every platform.

An arrow means “signed”: the client verifies signatures from the bottom up to a root in the trust store.

The three levels of a chain

The root key is guarded with special care: it takes no part in issuing ordinary certificates, and at Let’s Encrypt the root key material is kept offline. The root issues intermediate certificates, and the intermediates sign the leaves; it is the intermediates that the server sends to the client along with its own certificate.

CertificateSigned byWhere it is keptSent over the network
Rootitself; trust comes from the trust storein the client’s trust storeno
Intermediatethe root CAon the serveryes
Leafthe intermediate CAon the serveryes

What the client checks

Path validation under RFC 5280 is not a single signature check but a set of conditions for every certificate in the chain:

  1. names: the subject of each certificate matches the issuer of the next, which is what links the certificates into a path;
  2. signatures: each certificate’s signature is verified with the public key of the certificate above it; trust in the root comes not from its self-signature but from its key already being in the trust store;
  3. validity: the current time falls within the validity period of every certificate, from the leaf to the root;
  4. Basic Constraints: certificates above the leaf have the CA flag set, and the pathLenConstraint limit prevents issuing intermediates from intermediates without end;
  5. purpose: the key usage and extended key usage extensions permit the key to be used for a TLS server.

Revocation is checked as a separate step with its own mechanisms, CRL and OCSP; see the section “Certificate revocation”.

Checking a chain with openssl

The openssl verify command builds the path the way a client does: -CAfile supplies the root from the trust store, -untrusted supplies the intermediates, and -show_chain prints the assembled chain with its depth levels.

bashchecking your own chain
# the root is already in the trust store (root.pem),# the intermediate is passed separatelyopenssl verify -CAfile root.pem \  -untrusted intermediate.pem -show_chain leaf.pem
textexample output
leaf.pem: OKChain:depth=0: CN=example.com (untrusted)depth=1: CN=Test Intermediate (untrusted)depth=2: CN=Test Root

Without the intermediate, the path cannot be completed: the command reports unable to get local issuer certificate (error 20), because the client has the leaf issuer’s public key neither in the trust store nor among the certificates supplied. A browser sees the same thing when the server sends only the leaf.

bash
# without the intermediate the chain cannot be builtopenssl verify -CAfile root.pem leaf.pem
textexample output
CN=example.comerror 20 at 0 depth lookup: unable to get local issuer certificateerror leaf.pem: verification failed

Let’s Encrypt chains

Let’s Encrypt keeps two roots in platform trust stores, ISRG Root X1 (RSA, 2015) and ISRG Root X2 (ECDSA, 2020), and is preparing a change of generation: Root YE and Root YR were created in 2025 but are not yet accepted into the main stores. Until a new root is accepted, an older root signs it; this cross-signing gives the same certificate several equally valid chains.

Chain ends atSizeCompatibility
ISRG Root X1the longestmaximum: the root has been in trust stores since 2016
ISRG Root X2shorterclients with trust store updates from about 2022
Root YE, Root YRshorternot yet in the main root stores

The ACME client chooses the chain: by default Let’s Encrypt serves the most compatible one, and you request an alternative with a flag, which in Certbot is --preferred-chain. Certificates with an ECDSA key are issued from ECDSA intermediates and those with an RSA key from RSA intermediates; two intermediates of each type are currently in rotation.

fullchain.pem and privkey.pem

An ACME client saves the issued chain to files: with Certbot, fullchain.pem holds the leaf and the intermediates, and privkey.pem holds the leaf’s private key. You configure the server with both files, for example in nginx like this:

FileContentsWhere to use it
fullchain.pemleaf and intermediatesthe certificate setting: ssl_certificate
privkey.pemthe leaf’s private keythe key setting: ssl_certificate_key
nginxnginx.conf, server block
ssl_certificate     /etc/letsencrypt/live/example.com/fullchain.pem;ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;

Certificate Transparency

Publicly trusted CAs record every certificate they issue in public Certificate Transparency (CT) logs, and the log returns a signed certificate timestamp (SCT) for the entry. The logs reveal when a certificate is issued for someone else’s domain: Let’s Encrypt submits all of its certificates there and runs its own logs too.

Section sources

the section is written from these pages

ACME and Let’s Encrypt

ACME (Automatic Certificate Management Environment) is a protocol that lets a certificate authority issue and renew certificates without human involvement: an ACME client proves control of a domain by itself and collects the finished certificate. Let’s Encrypt is the largest certificate authority that works only through ACME.

The protocol is defined in RFC 8555. The usual cycle: the client registers an account, creates an order, proves control of the domains by completing a challenge, submits a certificate signing request (CSR) and downloads the issued certificate. The same flow works with any other ACME-enabled CA; only the limits and lifetimes below are specific to Let’s Encrypt.

HTTP-01 challenge; other challenge types would replace step 2.
  1. The client sends an order (new-order) listing the domains, for example example.com; the server returns the order and an authorisation for each domain.
  2. The client completes a challenge of the chosen type and tells the server it is ready.
  3. The server checks control of the domain from its side.
  4. Once all authorisations are valid, the client finalises the order (finalize): it sends a CSR containing its domains and public key.
  5. The server signs the certificate; the client downloads it together with the chain of intermediate certificates.

Domain validation challenges

A challenge is a way to prove to the server that you control a domain. The client picks the type; for most sites the default, HTTP-01, is enough.

FeatureHTTP-01DNS-01TLS-ALPN-01
What it provesa file on your web servera TXT record in DNSa special certificate on port 443
Whereport 80, path /.well-known/acme-challenge/the domain’s _acme-challenge recordport 443, ALPN protocol
Wildcardnoyesno
Multiple serversthe file must be on each oneone DNS recordeach one must answer
When to choose ityou have a site on port 80: the defaultwildcard certificates, no port 80, DNS with an APIrarely: proxies, IP addresses

With HTTP-01, the client places a file containing a token and the account key thumbprint at http://example.com/.well-known/acme-challenge/<token>; the CA fetches it over port 80 only and follows redirects only to ports 80 and 443. With DNS-01, the client creates a TXT record _acme-challenge.example.com whose value is derived from the token; it is the only challenge that works for a wildcard certificate for *.example.com. TLS-ALPN-01 is completed entirely at the TLS level and is mostly needed by authors of proxy servers.

ACME clients

Let’s Encrypt recommends starting with Certbot: it runs on many systems, installs the certificate into nginx or Apache for you and renews it. Other clients, such as acme.sh, GetSSL, dehydrated, Certimate and dozens more, are listed on the clients page; all of them use ACMEv2 (RFC 8555), as the old ACMEv1 protocol was switched off in 2021.

bashon a server with a domain
# issue: the validation file goes into /var/www/examplecertbot certonly --webroot \  -w /var/www/example \  -d example.com -d www.example.com # renew all certificates from /etc/letsencryptcertbot renew

For a wildcard certificate, Certbot uses a DNS provider plugin such as --dns-cloudflare, which creates and removes the TXT record itself. The --manual plugin, where you add records by hand, cannot renew automatically and is only suitable for a one-off certificate.

Renewal and lifetimes

Let’s Encrypt certificates live for 90 days, and renewal must be automatic: a manual procedure that comes round every three months does not scale and gets forgotten. The client decides when to reissue; so that the service picks up the new certificate, Certbot runs your hook script, which you set up at installation or place in /etc/letsencrypt/renewal-hooks/deploy.

The server suggests a renewal window through ARI (ACME Renewal Information, RFC 9773): the client periodically asks when to renew the current certificate, and such an order does not count against any limit. For shorter lifetimes there are profiles: classic is the usual 90 days, tlsserver is 45 days and shortlived is about 6 days. Lifetimes will only get shorter: industry rules will cap certificates at 47 days from 15 March 2029, and Let’s Encrypt plans to reach 45 days by February 2028.

Limits and the staging environment

Limits exist so that anyone can use a domain; an ordinary site will not notice them. The main ones are 300 new orders per account per 3 hours, 50 certificates per registered domain per week and 5 certificates for the same set of names per week. Renewals through ARI do not count against any limit.

LimitValue
New orders per account300 per 3 hours
Certificates per registered domain50 per 7 days
Certificates per set of names5 per 7 days
Failed validations per domain5 per hour

CAA: who may issue

A CAA (Certification Authority Authorization) record in DNS restricts which certificate authorities may issue certificates for a domain. One line on the registered domain is enough:

textDNS zone
example.org.  CAA 0 issue "letsencrypt.org"

Without a CAA record, any CA may issue. For Let’s Encrypt nothing needs configuring: domain validation is mandatory anyway (RFC 8555 requires it before every issuance). An issuewild record separately permits wildcard certificates; the CA honours the record closest to the name, so a subdomain can allow a different CA.

Section sources

the section is written from these pages

Certificate revocation

Revocation is the cancellation of a valid certificate before its expiry: it is how a certificate authority (CA) declares that a key can no longer be trusted. Clients learn about revocation from CRLs and OCSP responses, but they do not always check them, so the reliable defence against a leaked key is a short certificate lifetime.

When to revoke

A certificate is revoked when it can no longer be trusted. The most common case is private key compromise: the key has reached someone else, for example because it was published by accident, copied from the server, or an attacker took over the server and DNS and issued their own certificate. Other reasons are an issuance error (the certificate was issued for the wrong name or breaks CA rules), a change of domain owner, and a site being shut down so the certificate is no longer needed. Revoking certificates with compromised keys is an obligation of a Let’s Encrypt subscriber under the subscriber agreement.

ReasonRFC 5280 codeWhen to choose it
unspecifiedunspecified (0)no suitable code exists; the CA will reject any other code
key compromisekeyCompromise (1)you have reason to believe the private key has leaked
supersededsuperseded (4)the certificate was reissued to replace the old one
cessation of operationcessationOfOperation (5)the domains were sold or the site is closing

How clients learn about revocation: CRL

A certificate revocation list (CRL) is a document signed by the CA that lists the certificates revoked up to the moment it was issued: for each revoked certificate it gives the serial number, the revocation date and a reason code (RFC 5280). The CA publishes CRLs regularly, even empty ones: the nextUpdate field says when the next list will appear, and the CA must include it. The client fetches the CRL from the address in the certificate’s own cRLDistributionPoints extension and checks the serial number against the list. Until a new CRL is published, a freshly revoked certificate does not appear in the old list.

A CRL covering a whole issuer is large and does not scale as revocations grow; RFC 9325 calls this a known problem with CRLs. The list is split into parts, and delta CRLs carry the changes since the previous issue. You can check a certificate against a CRL by hand with openssl verify and the -crl_check option: without a current CRL, the check fails with an error.

bashchecking against a CRL on your own machine
openssl verify -crl_check -CAfile chain.pem cert.pem

How clients learn about revocation: OCSP

OCSP (Online Certificate Status Protocol) is a protocol in which the client asks a responder for the status of a single certificate in real time. The request contains the serial number and hashes of the issuer’s name and public key; the response is signed by the CA or its delegated responder and carries a status: good (not revoked), revoked (revoked; also returned for certificates that were never issued) or unknown (the responder does not know this certificate). A response is valid for a limited time: thisUpdate is when the status was correct, nextUpdate is when to expect a newer one. The CA puts the responder address in the authorityInfoAccess extension; openssl x509 -ocsp_uri shows it. Let’s Encrypt does not publish OCSP addresses, only CRLs.

basha certificate’s status from an OCSP responder
openssl x509 -in cert.pem -noout -ocsp_uriopenssl ocsp -issuer chain.pem -cert cert.pem \  -url http://ocsp.example.org -resp_text

In its basic form, OCSP puts load on the responder and lets it track the client; RFC 9325 names both as problems with the protocol. Clients also usually “soft-fail”: if the responder does not answer, they carry on with the connection anyway, because otherwise revocation would be a convenient way to take down someone else’s site (RFC 9325).

OCSP stapling

With OCSP stapling, the server fetches the signed OCSP response itself and “staples” it to the handshake: the client verifies the CA’s signature without contacting the responder. This spares the client a request to the responder and spares the responder some load. But an active attacker on the path can simply leave the response out, and soft-fail lets the connection through (RFC 9325). The strict mode (must-staple) is set by a certificate with the RFC 7633 extension, which the server operator requests from the CA: clients abort the handshake if no stapled response is attached. Client behaviour depends on their settings, so before requiring must-staple, weigh the consequences (RFC 9325).

To enable stapling in nginx, use the directives ssl_stapling on and ssl_stapling_verify on; nginx takes the responder address from the certificate extension. ssl_trusted_certificate needs the root and the full issuer chain, and resolver is needed to resolve the responder’s name.

nginxnginx.conf, server block
ssl_stapling on;ssl_stapling_verify on;ssl_trusted_certificate /etc/nginx/chain.pem;resolver 192.0.2.1;

How to revoke a certificate in ACME

Revocation in ACME is a request to the revokeCert resource (RFC 8555). There are three ways to prove the right to revoke: sign the request with the account that issued the certificate, with another account that has proved control of the domains, or with the certificate’s own private key. The certbot revoke tool does this for you: by default with the account that issued the certificate, and with --key-path using the certificate’s key, which lets you revoke someone else’s certificate whose key has leaked (Let’s Encrypt).

bashrevoking with the account, on the server
certbot revoke \  --cert-path /etc/letsencrypt/archive/example.com/cert1.pem \  --reason keyCompromise

If the account no longer exists but you still have the key, download the certificate from the Certificate Transparency log (crt.sh) by the hash of its public key and revoke it with the key:

bashpublic key hash for searching crt.sh
openssl pkey -in privkey.pem -pubout -outform DER \  | openssl sha256

After revocation, read the status from the issuer’s CRL or from an OCSP response: revocationTime is the revocation date and revocationReason is the reason (RFC 6960). If you try to revoke an already revoked certificate again, the ACME server responds with the error alreadyRevoked (RFC 8555).

Short lifetimes instead of revocation

Revocation checks are incomplete: a CRL lags behind, OCSP fails when the responder is unreachable, and must-staple is rare (RFC 9325). A short lifetime is therefore a practical alternative: a certificate that is about to expire goes away on its own. At Let’s Encrypt the default lifetime is 90 days and the shortlived profile gives about 6; short lifetimes also limit the damage from an issuance error. Revocation keeps its role, though: a key compromise is stopped immediately, without waiting for the lifetime to end. Lifetimes and renewal are described in this reference, in the section “ACME and Let’s Encrypt”.

The critical path is revocation after a key compromise; renewal is planned 30 days ahead.

Section sources

the section is written from these pages

Mutual TLS (mTLS)

Mutual TLS (mTLS) is a TLS handshake in which a certificate verifies not only the server but also the client: the server requests a client certificate with a CertificateRequest message, and the client proves it owns the key with a signature in CertificateVerify. This is how services recognise each other and how APIs are opened only to partners.

The key difference from ordinary HTTPS is that the client’s certificate is issued by your own certificate authority (CA): you decide who gets one, for how long, and when to revoke it.

Up to CertificateRequest it is an ordinary handshake; {…} means the message is encrypted.

How mTLS differs from an ordinary handshake

Without mTLS, only the server authenticates: it sends Certificate and CertificateVerify, and the client stays anonymous. With mTLS, a TLS 1.3 server sends CertificateRequest right after EncryptedExtensions, which is already the encrypted part of the handshake. The client’s reply must include Certificate and CertificateVerify before its Finished.

In CertificateVerify, the client signs the whole handshake with its private key: this is proof of key ownership, not just presenting a file. A certificate copied without its key does not open a connection.

A client with no suitable certificate replies with an empty Certificate, which is not necessarily a refusal. The server decides whether to continue without client authentication or to cut the connection with a certificate_required alert.

Your own CA for client certificates

Set up a separate CA for clients: clients and servers live in different trust stores, and revocation does not affect server certificates. The chain is your own root certificate and, as you grow, intermediates. The server puts this CA’s root, or an intermediate beneath it, into its trust store and uses it to verify the client’s chain. How chains work is covered in the section “Chains of trust”, and revocation in “Certificate revocation”.

The server lists the CAs it accepts in the certificate_authorities extension inside CertificateRequest, and the client picks a certificate from that list. The client can send the same extension in ClientHello to hint to the server which certificate to choose.

bashon the host
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 \  -keyout ca.key -out ca.pem -days 3650 -noenc \  -subj "/CN=Example Internal Client CA" -sha256 # issue a client certificate: key, CSR, signed for 397 daysopenssl req -newkey ec -pkeyopt ec_paramgen_curve:P-256 \  -keyout web.key -out web.csr -noenc \  -subj "/CN=web.internal.example" \  -addext subjectAltName=DNS:web.internal.example openssl x509 -req -in web.csr -CA ca.pem -CAkey ca.key \  -out web.pem -days 397 -sha256 -copy_extensions copy

Give each service its own key and its own certificate. A leaked key defeats the scheme: anyone can impersonate with it, and reissuing every client’s certificates is laborious.

Where it is used

Service-to-service traffic: internal calls between services, where each side verifies the other against the internal CA’s certificate. Partner APIs: access by client certificate instead of static tokens.

OAuth mTLS (RFC 8705) is another use: the client authenticates to the authorisation server with mTLS instead of a client_secret, and the issued tokens are bound to the client certificate. For details, see the OAuth and OIDC reference.

WhereWho the client isNote
Service-to-servicea service with a certificate from the internal CAbetween all pairs of services
Partner APIsan external partnerrevocation on request
OAuth mTLSan OAuth clientRFC 8705

Testing with openssl s_client

Test with the openssl s_client client: the -cert and -key flags supply the client certificate and key, and they are used only if the server asks for them. -cert_chain or -chainCAfile supplies the chain for the certificate.

bashon the host
openssl s_client -connect api.example.com:443 \  -servername api.example.com \  -cert client.pem -key client.key \  -cert_chain chain.pem -brief

The full output includes the “Acceptable client certificate CA names” list: the CAs whose certificates the server is willing to accept; -brief prints a short summary of the negotiation. Without a CertificateRequest, the client will not send its certificate, and that is normal: the server did not ask for it.

Common mTLS errors

The client did not send a certificate: the server sends certificate_required if policy demands client authentication, or carries on anonymously and the application then fails its own checks. A common cause is that the client did not find its CA in the certificate_authorities list from CertificateRequest and stayed silent.

The certificate was not accepted: unknown_ca means the client CA’s root is not in the server’s trust store, certificate_revoked means the certificate was revoked (see “Certificate revocation”), and certificate_expired means it has expired.

Section sources

the section is written from these pages

Security: recommended configuration

Today a server enables TLS 1.3 and TLS 1.2; versions 1.0 and 1.1 are prohibited (RFC 9325). Use ECDHE for key exchange and AEAD cipher suites: AES-GCM or ChaCha20-Poly1305. New protocols need only TLS 1.3: TLS 1.2 is frozen and will get no new features.

TLS versions

The version requirements: never negotiate SSL 3.0, TLS 1.0 or TLS 1.1, and support TLS 1.2 and TLS 1.3. TLS 1.3 encrypts almost the whole handshake and drops obsolete primitives, so it is secure without extra tuning. TLS 1.2 can also be configured well, but every decision is manual.

TLS 1.2 is frozen: the TLS working group accepts only urgent security fixes, new Exporter labels and ALPN identifiers for it. Post-quantum cryptography will not be standardised for TLS 1.2 at all, only for TLS 1.3 and later (RFC 9851). So new protocols must require TLS 1.3 by default and may allow TLS 1.2 only as a fallback when TLS 1.3 is unavailable (RFC 9852).

VersionStatusAction
TLS 1.3main versionenable everywhere; the only version for new protocols
TLS 1.2support is requiredenable for older clients; configure manually
TLS 1.0 and 1.1prohibiteddisable
SSL 3.0insecurealways disable

Cipher suites and key exchange

In TLS 1.3 the standard fixes the cipher suites itself. They are all AEAD (authenticated encryption): AES-GCM and ChaCha20-Poly1305, so there is nothing to choose. In TLS 1.2 you configure the suites: RFC 9325 recommends four, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 and its variants with AES_256_GCM and ECDSA. Clients should offer TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 first, and servers must prefer it over weaker suites.

RFC 10015 prohibits RSA key exchange and finite-field Diffie–Hellman in TLS 1.2: clients must not offer such suites and servers must not select them. The reason is the lack of forward secrecy: a stolen long-term RSA key also decrypts old recorded traffic. Static key exchange (TLS_DH_*, TLS_ECDH_*) is not recommended for the same reason. Ephemeral finite-field Diffie–Hellman (TLS_DHE_*) is also prohibited in TLS 1.2, but acceptable in TLS 1.3. Do not use CBC suites without the encrypt_then_mac extension; always disable Null, RC4, anonymous (TLS_*_anon_*) and EXPORT suites.

SuitesStatus in TLS 1.2
TLS_ECDHE_* with AES-GCMrecommended: AEAD and forward secrecy
TLS_RSA_*prohibited: RSA key exchange without forward secrecy
TLS_DH_*prohibited: static Diffie–Hellman
TLS_DHE_*prohibited; acceptable in TLS 1.3
TLS_ECDH_*not recommended: static ECDH
any CBC suitesonly with encrypt_then_mac

List key exchange groups in order of preference: the server picks a group it shares with the client and respects that order. Support X25519 and P-256. To protect against quantum computers, hybrid key exchange (ML-KEM with ECDHE) is standardised for TLS 1.3 only: RFC 10024 defines the X25519MLKEM768 group and others, while post-quantum cryptography will not be standardised for TLS 1.2 at all (RFC 9851). It is best not to set Diffie–Hellman parameters for TLS 1.2: the matching suites are prohibited anyway.

iniopenssl.cnf: group order
openssl_conf = openssl_init[openssl_init]ssl_conf = ssl_module[ssl_module]system_default = tls_system_default[tls_system_default]Groups = X25519MLKEM768:x25519:prime256v1:x448:ffdhe2048:ffdhe3072

The Mozilla configuration generator provides ready-made server profiles (modern and intermediate). The project has been handed over to the tlsref.org community and will become a source only after the owner’s decision. Until then, follow RFC 9325 and OWASP.

Disable TLS-level compression: attacks such as CRIME use it to extract secret cookies. TLS 1.3 has no compression at all. In TLS 1.2, renegotiation without the protective renegotiation_info extension is insecure, so implementations must support it (RFC 9325). TLS 1.3 has no renegotiation.

HSTS and OCSP stapling

Web servers must support HSTS (HTTP Strict Transport Security), and using it is recommended: the Strict-Transport-Security header forbids the browser to visit the site over HTTP and to click through certificate warnings. For a public site, keep a redirect from port 80 to HTTPS. For API-only endpoints, disable HTTP entirely; if that is impossible, reject HTTP requests instead of redirecting them.

OCSP stapling: a server should support OCSP and attach the response using the status_request extension, so the client does not have to query the certificate authority itself. Note the limitation: an active attacker can strip the request for a stapled response, so the scheme is strengthened with the must-staple extension, depending on your operating conditions. For details, see the section “Certificate revocation”.

Keys: ECDSA and RSA

ParameterValue
RSA keyat least 2048 bits
ECDSA keyP-256 curve
Certificate signatureSHA-256; MD5 and SHA-1 are not acceptable

An ECDSA key gives a short public key and therefore a smaller certificate, so fewer bytes in every handshake. If your clients do not support ECDSA, use RSA 2048 or longer. One server can hold both certificates and serve each client the one that suits it.

Protecting the private key

Keep the private key only on the server that uses it to sign the handshake: not in a repository, not in a container image and not in an unprotected backup, because every extra copy raises the chance of compromise. Set minimal file permissions: only the owner the server runs as should be able to read it.

bashon the server
# only the owner can read the keysudo chown root:root /etc/ssl/private/example.keysudo chmod 600 /etc/ssl/private/example.key

Reissue the certificate on a schedule; for how to set that up, see the section “ACME and Let’s Encrypt”. If a key is compromised, reissue the certificate with a new key and revoke the old one: revocation is an important tool for recovering from an attack (see “Certificate revocation”).

Section sources

the section is written from these pages

Common errors and troubleshooting

To find why a TLS connection failed, use the openssl s_client client: it shows the course of the handshake, the server’s chain and the verification verdict. Then check three things in order: the chain, the validity period and the name in the certificate. Each accounts for its own class of errors.

Order of checks

  1. openssl s_client -connect example.com:443 -servername example.com: did the handshake complete, and with which version and cipher;
  2. the Verify return code line at the end of the output: the verdict on the chain, with the error text; the -showcerts flag prints all certificates as the server sent them;
  3. validity dates: openssl x509 -in cert.pem -noout -dates for a saved certificate;
  4. the name in subjectAltName: openssl x509 -in cert.pem -noout -ext subjectAltName, or a one-step check with openssl x509 -in cert.pem -noout -checkhost example.com;
  5. protocol version and cipher suite: the Protocol version line in the -brief output.
bashon the host
openssl s_client -brief -connect example.com:443 \  -servername example.com
textexample output
CONNECTION ESTABLISHEDProtocol version: TLSv1.3Ciphersuite: TLS_AES_256_GCM_SHA384

Each step rules out one layer. If the handshake completes, network and port problems are behind you; a verdict of OK means the chain and dates are fine. Next, check the name and what the application does with the connection. s_client is a diagnostic tool: it prints verification errors but carries on. In automated checks, pass -verify_return_error so that an error aborts the connection.

unable to get local issuer certificate

Cause: the client built the chain but could not find the issuer of the next certificate, because the server is missing an intermediate certificate. The server sends its own certificate and the intermediates; the client takes the root from its own trust store. Check the -showcerts output: it should contain the leaf and the intermediates. With Let’s Encrypt, give the server the whole fullchain.pem file, not just the leaf; the files are explained in the section “Certificate chains”.

bashon the host
openssl s_client -connect example.com:443 \  -servername example.com -showcerts

You can run the same test offline, locally, with the root taken from a file: -CAfile sets the root and -untrusted supplies the intermediates.

bashchecking your own chain
openssl verify -CAfile root.pem \  -untrusted intermediate.pem leaf.pem
textexample output
leaf.pem: OK

certificate has expired

Cause: the validity period has ended, so the certificate’s notAfter field is earlier than the current time. The opposite case is notBefore not yet reached: the certificate is “not yet valid”. Clocks matter on both sides: a wrong clock on the client rejects a valid certificate, so if a validity error appears suddenly, check the time on your own machine. Show the dates with openssl x509 -in cert.pem -noout -dates; renewal is covered in the section “ACME and Let’s Encrypt”.

bashon the host
# compare the clock with the certificate datesdateopenssl x509 -in cert.pem -noout -dates

hostname mismatch

Cause: the name you connect with does not match any of the names in the certificate’s subjectAltName (SAN) extension. -ext subjectAltName lists the certificate’s names, and -checkhost tests a single name. Common cases: the name was not included in the certificate order, the certificate was issued for another host behind the load balancer, or the domain with and without www count as different names. The name reaches the server in the server_name extension (SNI): the -servername flag of s_client sets it explicitly; without it, a server on a shared address replies with its default certificate.

bashon the host
openssl x509 -in cert.pem -noout -ext subjectAltNameopenssl x509 -in cert.pem -noout -checkhost example.com
textexample output
X509v3 Subject Alternative Name:    DNS:example.com, DNS:www.example.com

Error on a non-TLS port or through a proxy

Symptom: the connection drops at the very first step and s_client prints wrong version number, meaning an invalid version number in the protocol record. Cause: a service without TLS answers on the TLS port, such as a plain HTTP server on 443, or a proxy intercepts the path. The client sends a TLS record and gets plain text back, so parsing fails on the record version. Check what is actually listening on the port, then retry against a port that is required to speak TLS. For services that use STARTTLS, pass the -starttls flag so s_client switches the protocol to TLS itself.

bashon the host
openssl s_client -brief -starttls smtp \  -connect smtp.example.com:587

Conversely, plain TLS to a STARTTLS port gives the same symptom: the server expects a protocol command but receives a TLS record, and its plain-text reply breaks parsing, giving wrong version number again. Sometimes the connection is simply dropped instead of getting a reply.

handshake_failure

Cause: the two sides share no set of parameters (protocol version, cipher suites or key exchange groups), and the server aborts the handshake with this alert. The meanings of all alerts are in the table in the cheat sheet, in the group “Handshake alerts”. Compare the versions: a client that supports only TLS 1.3 cannot negotiate with a server that has TLS 1.3 disabled and only 1.2 left. A new server without TLS 1.2 will reject an old client. Which versions and suites to keep is covered by the recommendations in the section “Security: recommended configuration”; to pin the version for a test, use the -tls1_3 or -tls1_2 flag of s_client.

bashon the host
openssl s_client -brief -tls1_2 -connect example.com:443 \  -servername example.com

If -tls1_2 works but -tls1_3 gives handshake_failure, the culprit is the server or an intermediate device that blocks newer versions. With no common versions at all, the handshake fails with the same alert; widen the list of supported versions on the side where it is too narrow.

Verification fails on one platform

Cause: each platform has its own trust store, updated on its own schedule. Verifying a Let’s Encrypt certificate on a platform comes down to whether its trust store trusts the ISRG Root X1 or ISRG Root X2 root: X1 has been in trust stores since late 2016, X2 since mid-2022. If a certificate verifies on some platforms but not all, Let’s Encrypt names an incomplete chain served by the server as the most common cause, so go back to the -showcerts check. Old systems whose trust stores are not updated can only be fixed by updating them.

SymptomCauseWhat to do
the handshake never reaches the certificatethe port is served by a non-TLS service, or a proxy intercepts the pathcheck what is listening on the port and the path to the server
Verify return code: unable to get local issuer certificatethe server did not send the intermediate certificatesuse fullchain.pem and check with -showcerts
certificate has expired, but the certificate is newthe client’s clock is wrongcheck the time with date and enable time synchronisation
hostname mismatchthe address name is not in the certificate’s SANcheck the SAN with -ext subjectAltName and reissue the certificate
the handshake fails only with old clientsold TLS versions are disabled on the serverthis is by design; update the client; for versions, see the section “Security”
the connection fails only in the API clientthe client does not trust the root: its trust store is out of dateupdate the root certificates of the system or the client

openssl verify with -CAfile and -untrusted checks files locally. It prints an error such as “error 24 at 1 depth lookup: invalid CA certificate” (the error number and the depth at which it was found) and tries to show all the problems in the chain at once. The diagnostic commands are collected in the cheat sheet, in the group “Inspect a connection”; the course of the handshake and the meaning of the alerts are in the section “The TLS 1.3 and 1.2 handshakes”.

Section sources

the section is written from these pages

Standards and their status

TLS and PKI are described by IETF documents. The current edition of TLS 1.3 is RFC 9846 (July 2026), which replaced RFC 8446 and RFC 5246, and the X.509 certificate format is defined by RFC 5280. This section is a map of those documents and a guide to reading RFCs.

Which documents are current

Internet standards are produced by the IETF: a document goes through a working group and review, and once published its number never changes. Corrections come out as separate RFCs marked “updates”, and replacement documents are marked “obsoletes”. The RFC Editor uses these links to flag an outdated document on its page.

DocumentWhat it definesStatusReplaced or extended by
RFC 9846TLS 1.3: handshake, records, cipher suitescurrentreplaced RFC 8446 and RFC 5246 (TLS 1.2)
RFC 5280X.509 certificates and revocation listscurrentupdated by RFC 6818 and eight more RFCs, the latest being RFC 10007
RFC 8555the ACME protocol for issuing certificatescurrentextended by RFC 9773
RFC 9773renewal information hints (ARI)currentnew document, June 2025
RFC 6960online revocation checking (OCSP)currentupdated by RFC 8954 and RFC 9654
RFC 9325 (BCP 195)secure TLS and DTLS configurationcurrent practiceextended by RFC 9852 and RFC 10015
RFC 8996 (BCP 195)prohibition of TLS 1.0 and TLS 1.1current practicecomplements BCP 195 together with RFC 9325
RFC 9851TLS 1.2 feature freezecurrentexceptions: security fixes, Exporter labels, ALPN identifiers
RFC 9852 (BCP 195)new protocols must use TLS 1.3current practicetightened RFC 9325
RFC 10015prohibition of obsolete key exchange methods in TLS 1.2currentupdates RFC 5246, RFC 9325 and others
RFC 9525verifying the server name in a certificatecurrentreplaced RFC 6125
RFC 9849ClientHello encryption (ECH)currentnew document, March 2026
RFC 9162public certificate logs (CT 2.0)experimentalreplaced RFC 6962

What changed in the latest editions

The main event is RFC 9846: TLS 1.3 is described afresh, and RFC 5246 (TLS 1.2) and its dependent documents are retired along with it: the ticket mechanism of RFC 5077, the extended master secret extension (RFC 7627) and the elliptic curves of RFC 8422. In place of tickets the new edition introduces its own mechanism, keeps TLS 1.2 support and sets extra requirements for it, and also updates RFC 5705 on the exporter and RFC 6066 on extensions.

Beyond that, TLS 1.2 is frozen: RFC 9851 allows changing it only with urgent security fixes, new Exporter labels and ALPN identifiers. Nobody will specify post-quantum algorithms for TLS 1.2, because the working group’s effort goes into TLS 1.3 and later. At the same time, RFC 10015 prohibited key exchange without forward secrecy in TLS 1.2, namely static RSA and finite-field exchange, and declared static ECDH undesirable. For the cipher suites to configure, see the section “Security: recommended configuration”.

Obsolete documents that are still cited

Old guides and configuration tips mention numbers that are no longer on the list of current documents:

  • RFC 8446 is the first edition of TLS 1.3; in all new texts it is replaced by RFC 9846.
  • RFC 5246 is TLS 1.2; it was retired by RFC 9846, which also sets the new requirements for TLS 1.2.
  • RFC 7525 is the former edition of BCP 195; it was replaced by RFC 9325, which has itself since been extended.
  • RFC 6125 holds the server name verification rules; it was replaced by RFC 9525.
  • SSL 3.0 (RFC 6101) is kept by the RFC Editor with Historic status and is not among the current standards.

How to read requirements in an RFC

Requirements in an RFC are written with the capitalised words MUST, MUST NOT, SHOULD and MAY. Under BCP 14 (RFC 2119 and RFC 8174), a capitalised SHOULD is a strict rule that you may depart from only for a valid reason and with full awareness of the consequences. Lowercase “should” is ordinary advice, and a capitalised MAY is explicit permission.

bashon the host
curl -sI https://example.com | head -1openssl s_client -connect example.com:443 -brief </dev/null

A quick server check: curl shows that a TLS connection was established at all, and s_client -brief shows the protocol version and the selected cipher suite. For a full analysis of a connection, see the section “Cheat sheet: ports and openssl commands”.

Section sources

the section is written from these pages

End of the reference

What changed

revision history · 4 entries

Every edit is saved as a revision: a snapshot of the reference, the reason and a summary of changes. The published version changes only after the same checks as at creation.

  1. Manual edit

    reason: manual edit
  2. Manual edit

    reason: manual edit
  3. Manual edit

    reason: manual edit
  4. Reference updated

Weekly check

How the reference is checked

Once a week — and right after news of a release or a vulnerability — the reference is checked in three steps.

  1. 1. Freshness

    Sections are compared with the release notes and changelogs from the official sources and with the topic’s news.

  2. 2. Errors

    Every section is read again: wrong facts, outdated APIs and flags, broken examples.

  3. 3. Links — by an HTTP request

    Every source link must respond. A broken link is a reason to recheck the section.

No findings — only the date changes. Findings — only the affected sections are rewritten, and they appear in “What changed”. A new version replaces the published one only after passing the same checks as at creation.

Statuses

Verified
no findings
Updated
sections rewritten, edits are listed
Rechecking
while the check runs, the previous version stays open
Needs review
disputed points: the verified version is shown, editors review

Last check

18 Nov · Check · updated · no findings

Found an error in the reference?

On the topic

tracks, news and other references
The whole “TLS and PKI” topic
12 sections
Another reference · DevOps & cloud

Ansible

Verified 6 Nov
All references · 61