PKI explained

PKI vs TLS

The short answer

PKI vs TLS is not a choice between two things: TLS is the protocol that secures a connection, and PKI supplies the certificates TLS uses to prove who the server is. In TLS 1.3, fresh encryption keys come from an ephemeral (ECDHE) key exchange, and the certificate's key only signs the handshake. SSL is TLS's obsolete predecessor.

Who it is for
Level
Practitioner
Reading time
About 8 minutes
On this page
  1. PKI vs TLS: what is the difference?
  2. How does TLS use PKI?
  3. Does the certificate’s key encrypt the connection?
  4. What about SSL?
  5. Can you have TLS without PKI, or PKI without TLS?
  6. Is it a PKI problem or a TLS problem?
  7. Where to go next
  8. Frequently asked questions
  9. Keep going

“Do I need PKI or TLS?” is a common question, and it has a surprising answer: on the web you always use both, because they do different jobs. This page explains where public key infrastructure ends and TLS begins, for developers who meet both in error messages, IT teams who configure them, and anyone who wonders how HTTPS is put together. For the full message-by-message picture, read The TLS 1.3 handshake.

PKI vs TLS: what is the difference?

TLS, Transport Layer Security, is a protocol: a set of rules for two computers that want a private, tamper-proof connection. It agrees fresh keys, encrypts the data and detects any change on the way. TLS 1.3 is defined in RFC 9846.

PKI is a trust system: certificate authorities, certificates, trust stores and the rules around them. It answers one question that TLS cannot answer by itself: whose public key is this? Its certificate format is profiled in RFC 5280.

TLS PKI
What it is A protocol between a client and a server A system of CAs, certificates, trust stores and rules
Its main job Agree keys, encrypt, protect integrity Bind public keys to names that others can check
Where it lives In your TLS library: OpenSSL, Schannel, BoringSSL, Java’s JSSE In certificates, CAs, and the trust store on each device
Main standard RFC 9846 (TLS 1.3) RFC 5280 (X.509 certificates)
What failure looks like No common version or cipher, a broken handshake Unknown issuer, wrong name, expired certificate
Used without the other? Rarely: with pre-shared keys or raw public keys Yes: code signing, email, documents, devices

TLS without PKI would encrypt your data perfectly, to whoever answered, including an attacker in the middle. PKI without TLS would be certificates with no connection to protect. HTTPS needs both.

How does TLS use PKI?

The TLS 1.3 specification lists authentication first among its security properties: “The server side of the channel is always authenticated; the client side is optionally authenticated” (RFC 9846, section 1). On the web, that server authentication is done with PKI certificates.

What TLS does and what PKI does in one HTTPS connection, where they meet, and what the certificate key really does One HTTPS connection needs both TLS: the protocol • fresh ECDHE key exchange • keys that encrypt the data • integrity: nothing altered • versions and cipher suites TLS 1.3: RFC 9846 PKI: the trust • certificate from a CA • chain to a trusted root • name and date checks • revocation and CT logs X.509 profile: RFC 5280 Where they meet: CertificateVerify the certificate's private key signs the handshake for this connection ✓ Certificate key signs proves who the server is ✗ Certificate key encrypts a myth: keys from ECDHE do
TLS protects the connection. PKI tells the client who is at the other end. They meet in one signature.

In one TLS 1.3 handshake, the two meet like this:

  1. TLS agrees keys. Client and server each send a fresh, one-time public key and derive the same shared secret, using an ECDHE key exchange. From here on, the handshake is encrypted.
  2. PKI supplies the identity. The server sends its certificate chain in the Certificate message (section 4.5.1): its own certificate and the intermediate that signed it.
  3. The client runs the PKI checks. It builds a chain to a root in its own trust store and checks the signatures, the dates and the name (Certificate chains).
  4. The certificate key proves possession. The server signs a hash of the handshake so far with the private key that belongs to its certificate, in CertificateVerify (section 4.5.2). The client checks it with the public key from the certificate.
  5. TLS finishes and protects the data. Both sides confirm the whole handshake with Finished messages, and the application data flows, encrypted with keys derived from the ECDHE secret.

Because the signature covers both sides’ fresh key shares, it ties this one connection to the certificate’s owner. An attacker in the middle could copy the certificate, but could not produce the signature.

In mutual TLS, the same happens in the other direction: the server asks for a certificate, and the client sends its own chain and its own CertificateVerify. Client certificates usually come from a private CA (Mutual TLS).

Does the certificate’s key encrypt the connection?

No. This is one of the most common misunderstandings about HTTPS. In TLS 1.3, the certificate’s private key is used for exactly one thing: the CertificateVerify signature. The keys that encrypt your data come from the ECDHE key exchange. Each side makes a new key pair for the connection and throws it away afterwards, so the session keys were never derived from the certificate. That gives forward secrecy: a certificate key stolen next year does not unlock today’s recorded traffic.

The myth has a history. TLS 1.2 still allowed “RSA key exchange”, in which the client encrypted a secret to the RSA key in the server’s certificate. Anyone who later stole that key could decrypt recorded sessions. TLS 1.3 removed it: “Static RSA and Diffie-Hellman cipher suites have been removed” (section 1.3). TLS 1.2 with ECDHE cipher suites also gives forward secrecy. Key exchange and hybrid encryption explains the idea in plain words.

Because TLS and PKI are separate, they also change separately, and the move to post-quantum cryptography shows it. The key exchange has already changed: X25519MLKEM768 hybrid post-quantum key exchange is on by default in Chrome, Firefox and Apple's operating systems (late 2024 in Chrome 131 and Firefox 132). The certificates have not: Publicly trusted TLS certificates still use classical signatures such as RSA and ECDSA; post-quantum signatures are not yet allowed in them (TLS Baseline Requirements, section 6.1.5). Post-quantum cryptography explains both migrations.

What about SSL?

SSL, Secure Sockets Layer, is the protocol TLS grew out of. When the IETF standardised it, it changed the protocol a little and renamed it TLS. Every SSL version is now prohibited or deprecated, and so are the first two TLS versions:

Version Published Status today
SSL 3.0 November 1996 Deprecated by RFC 7568 (June 2015), which says “SSLv3 MUST NOT be used”
TLS 1.0 RFC 2246, January 1999 Deprecated by RFC 8996 (March 2021)
TLS 1.1 RFC 4346, April 2006 Deprecated by RFC 8996
TLS 1.2 RFC 5246, August 2008 Still widely used; safe with ECDHE and AEAD cipher suites
TLS 1.3 RFC 8446, August 2018; now RFC 9846 The current version

SSL 2.0, older still, is prohibited by RFC 6176 (March 2011). Current browsers refuse SSL and TLS 1.0 and 1.1 by default, and the TLS configuration guide shows how to allow only TLS 1.2 and 1.3 on your servers.

So why do people still say “SSL certificate”? Habit, mostly. An “SSL certificate” is simply a TLS server certificate, and it does not depend on the protocol version: the same X.509 certificate works with TLS 1.2 and TLS 1.3. The old name also survives in software such as OpenSSL.

Can you have TLS without PKI, or PKI without TLS?

TLS without PKI is possible, but rare on the web. The TLS 1.3 specification allows authentication with public keys or with “a symmetric pre-shared key (PSK)” (section 1), and RFC 7250 lets both sides use bare public keys that each already knows. Both need the keys to be shared in advance, which works between devices you configure yourself, not with every website in the world. Switching certificate checks off is not “TLS without PKI”: it is TLS with no authentication, which encrypts your data to whoever answers.

PKI without TLS is everywhere. Operating systems check code-signing certificates before they run software. Mail programs check S/MIME certificates on signed email. PDF readers check document signatures, and factories put device certificates into chips for later use. PKI use cases lists more, and How does PKI work? follows one certificate from start to finish.

Is it a PKI problem or a TLS problem?

When a connection fails, the error message usually tells you which side broke. PKI errors are about the certificate and trust. TLS errors are about the protocol itself:

Error Side What it usually means
NET::ERR_CERT_AUTHORITY_INVALID PKI The chain does not lead to a root in the browser’s trust store
NET::ERR_CERT_COMMON_NAME_INVALID PKI The name you asked for is not in the certificate
NET::ERR_CERT_DATE_INVALID PKI The certificate has expired, or the device’s clock is wrong
unable to get local issuer certificate PKI A missing intermediate or an unknown root
ERR_SSL_VERSION_OR_CIPHER_MISMATCH Mostly TLS No TLS version or cipher suite in common
ERR_SSL_PROTOCOL_ERROR TLS The handshake broke, often because something other than TLS answered

PKI problems are fixed with certificates and trust stores: renew, send the full chain, add the right root. TLS problems are fixed in the server’s or client’s TLS settings. The error finder maps the exact message you see to its page:

Try it: Paste your errorOpen the full tool

Runs in your browser. Nothing you paste is sent anywhere.

The whole message or just the important line. A stack trace is fine; we look for the known parts.

Where to go next

Guided mission · free · no account · progress saves hereAssemble a trusted TLS connection — 7 minutesConnect key agreement, certificate validation and handshake proof before protecting application data.

Frequently asked questions

Which TLS versions should a server allow?

Allow TLS 1.2 and TLS 1.3 only, and prefer TLS 1.3. Switch off SSL 2.0, SSL 3.0, TLS 1.0 and TLS 1.1, which are prohibited or formally deprecated and refused by current browsers. Your certificate does not depend on this choice: the same certificate works with both TLS 1.2 and TLS 1.3, so changing versions is a server setting, not a new certificate.

Do I need a new certificate to move from TLS 1.2 to TLS 1.3?

No. The same X.509 certificate and private key work for both versions. TLS 1.3 changes how the key is used, not the certificate: an RSA key always signs the handshake, with the RSA-PSS scheme, and is never used for key transport, and ECDSA keys work as before. Most servers simply need a current TLS library and TLS 1.3 switched on in their configuration.

Can someone who steals my server's private key decrypt old traffic?

Not with TLS 1.3, and not with TLS 1.2 when it uses ECDHE cipher suites. The session keys came from one-time key pairs that were thrown away, so the certificate key never protected them. That property is called forward secrecy. The thief can, however, impersonate your server until the certificate expires or is revoked, so replace the key and have the certificate revoked at once.

Does HTTP/3 use the same certificates?

Yes. HTTP/3 runs over QUIC, and QUIC uses the TLS 1.3 handshake to agree keys and to authenticate the server, as described in RFC 9001. The server presents the same X.509 certificate chain and proves its key in the same way. What changes is the transport underneath: QUIC runs over UDP instead of TCP and protects its own packets with the keys TLS provides.

Is a company TLS-inspection proxy a PKI problem or a TLS problem?

Both. The proxy ends your TLS connection, opens its own connection to the real site, and then presents your device with a new certificate for that site, signed by a private root that IT installed in the device's trust store. Browsers accept it because of that root. Tools with their own trust store, such as Java, Node.js or Python with certifi, reject it until the company root is added to them.

Early edition. Written with AI assistance and checked against primary sources; an independent expert review is planned. Found a mistake? Tell us.

Last reviewed Edition 0.9