Skip to content

Why put a certificate inside a certificate?

, 9 min read

This week I wrote about why the NSA wants you to hurry on post-quantum cryptography, and before that about why cryptography should be boring. Both posts run into the same limit. A migration moves only as fast as the software that has to change, and moving off SHA-1 taught me that most of the calendar goes to getting that software updated, deployed, and old enough to retire.

Consider a service configured with one certificate file and one private key.

Where a certificate migration lands in a TLS deployment Apache, NGINX, MySQL, PostgreSQL and other applications sit on a TLS library such as OpenSSL. The library reads the certificate and key from the filesystem. Certificate automation, either an ACME client or a certificate lifecycle manager, writes each renewal to the same files. A single-certificate server can keep its existing file interface. APPLICATIONS one certificate path in this example Apache NGINX MySQL PostgreSQL … and the rest “do TLS with the certificate at this path” TLS library OpenSSL, BoringSSL, GnuTLS Certificate automation ACME client or lifecycle manager reads the certificate and key writes each renewal Filesystem fullchain.pem · privkey.pem same paths, new contents A single-certificate server can keep its existing file interface.

Apache, NGINX, MySQL, and PostgreSQL can all be configured with paths to a certificate and key. In a typical automated deployment, an ACME client or a certificate lifecycle management (CLM) product renews the certificate and writes it back to the same path.

The applications in the top row are the long tail. There are thousands of them, each on its own release schedule, and many are proprietary. If a server can load and serve a replacement certificate through its existing interface, its operator can deploy a new issuer without waiting for the application vendor.

A new IETF draft from David Benjamin, Corey Bonnell, John Gray, and Mike Ounsworth is built for this stack. Its formal title is Embedded Alternate Issuer Certificates. The draft’s filename gives it a better name, the Turducken.

A turducken is a chicken stuffed inside a duck stuffed inside a turkey. In the certificate version, two issuers certify the same server key. One certificate carries the pieces a client needs to rebuild the other.

A roasted turducken sliced open to show its layers of turkey, duck, chicken, and stuffing.

Photo: meatman.com

One file, two trust stores

Every client keeps a list of the root certificate authorities (CAs) it accepts, called its trust store. Today’s roots sign with RSA or elliptic curves, which a large enough quantum computer breaks. I’ll call them classical. The migration adds roots that use post-quantum signatures and then removes the classical ones.

An older client connects on Monday with only classical roots in its trust store. A newer client connects on Tuesday with only post-quantum roots. The server needs a certificate for each of them, and that holds with or without a Turducken. Web servers will serve both kinds of client at the same time for years.

A server that supports several certificates can choose one for each connection, using information the client offers about the signatures or issuers it accepts. That works when the server can make the choice and its operator can provision both credentials. What happens to a service whose configuration has room for just one?

A Turducken packs the two certificates into one file. It is a certificate that carries what a client needs to reconstruct a second certificate from a different issuer. The older client validates the certificate it has always understood. The newer client rebuilds the alternate certificate and validates it against its own trust store. The server presents both through the one-certificate interface the whole stack already has.

Same name, same key, two issuers

Three certificates explain the construction. All three carry the same hostname and the same server key.

The first is a regular certificate. A CA checks control of example.com and signs a certificate binding that name to the server’s public key. The diagram shows the fields that matter for this example.

A classical X.509 certificate A certificate with three fields that describe the server (name, public key, validity) and three that belong to the issuer (issuer name, serial number, signature). The client checks the issuer's signature and builds a path to a trusted root. X.509 CERTIFICATE Name example.com Public key the server’s key Valid 45 days Issuer Classical CA Serial assigned by this CA Signature Classical CA, over all of the above Describes the server Belongs to the issuer Client Checks the signature, then builds a path to a root it trusts.

The second is a Merkle Tree Certificate (MTC), a design the IETF is developing for the web. Replacing each signature in a conventional certificate chain with a post-quantum signature makes the chain larger. A Merkle Tree CA can authenticate a batch of certificates together. It arranges the entries in a hash tree. Each certificate carries a short list of hashes, called an inclusion proof, that lets the client check the entry against an authenticated subtree hash. The proof sits where the X.509 signature normally goes.

A standalone Merkle Tree Certificate The same server fields as the classical certificate, with issuer fields from a Merkle Tree CA. The signature field carries an inclusion proof and cosignatures. A small tree shows the certificate as a leaf, the sibling hashes carried in the proof, and the subtree hash at the top that the CA and its cosigners signed. MERKLE TREE CERTIFICATE (STANDALONE) Name example.com Public key the server’s key Valid 45 days Issuer Merkle Tree CA Serial position in the CA’s log Signature inclusion proof + cosignatures Subtree hash cosigned by the CA and its cosigners this certificate hashes carried in the proof

The Merkle Tree Certificates draft defines two forms. A standalone certificate carries the cosignatures a client can check under its policy for that CA. A landmark-relative certificate can omit those signatures because the client already trusts a relevant subtree hash. For the longer versions, see A Deep Dive on the Classical WebPKI and The Post-Quantum WebPKI.

The third is the Turducken. Both issuers certify the same name and key for the same validity period, so those fields travel once. The alternate issuer authenticates its own version of the certificate, including a binding to the outer issuer’s fields. The classical CA embeds the pieces needed to reconstruct that alternate in the extension that normally carries signed certificate timestamps (SCTs) from Certificate Transparency logs. It then signs the outer certificate. Older clients are expected to skip the unfamiliar entry in the SCT list.

A Turducken certificate and the two clients that read it A classical certificate whose embedded SCT extension also carries the alternate issuer's fields: the Merkle Tree CA's name, serial, inclusion proof and cosignatures. An upgraded client combines those with the shared server fields to rebuild and validate the Merkle Tree Certificate. An older client skips the entry and validates the outer classical signature. TURDUCKEN (THE FILE THE SERVER HOLDS) Name example.com Public key the server’s key Valid 45 days Issuer Classical CA Serial assigned by this CA Extension embedded SCT list ALTERNATE ISSUER Merkle Tree CA · serial inclusion proof + cosignatures Signature Classical CA, over all of the above Upgraded client Takes the server fields and the alternate issuer fields, rebuilds the Merkle Tree Certificate, and checks its proof. Trusts example.com via Merkle Tree CA Older client Skips the unfamiliar entry and checks the outer signature. Trusts example.com via Classical CA

The embedded MTC is standalone because the server has one file to offer, whatever tree data the client has. A client that trusts the Merkle Tree CA and gets the cosignatures its policy requires can validate the reconstructed certificate independently. It can do so even if it distrusts the classical CA. The two issuers can also revoke their certificates independently.

The two clients agree on which key belongs to example.com, and they reach that conclusion through different issuers. Changing how a client authenticates the issuer and changing the key the server uses in the handshake are separate parts of the post-quantum migration. A Turducken moves the first. The server keeps its existing key and moves to a post-quantum key in a later step.

Every client picks its own cutover

Three clients connect to the same server during the migration. An old client understands only the outer certificate. An upgraded client validates either path. A client whose operator has removed the classical roots connects through the MTC alone. The server presents the same Turducken to all three.

Each client crosses the cutover on its own schedule A timeline with four rows. The server presents the same Turducken and uses its classical key throughout. An old client accepts only the classical issuer. An upgraded client accepts either issuer after a software update. A third client accepts either issuer after its update and only the new issuer after its operator removes the classical root. time Serverone certificate file same Turducken for every client · server still uses its classical key Old clientsoftware as shipped classical issuer Upgraded clientboth roots installed either issuer software update Client past cutoverclassical root removed either issuer new issuer only software update cutover forgery under the classical issuer still works classical path closed for this client

The client’s cutover is the day its operator removes the classical roots. From then on, forging a certificate under one of those roots won’t fool that client. The server has a different cutover. Someone who can recover its classical key can still impersonate it, even after it starts serving a post-quantum key, if a trusted post-quantum issuer’s certificate for the old key is still valid. To finish, the service has to stop authorizing certificates for classical keys under those issuers and revoke the outstanding ones or let them expire.

Built to disappear

Turduckens are temporary. The draft reserves them for legacy services that can present only one certificate. There’s a cost to keeping that interface: every client receives the standalone proof and cosignatures, including the older clients that skip them. Those extra bytes can add handshake latency.

Once a server can select certificates, it can send a classical certificate to older clients and a post-quantum credential to upgraded ones. Until then, a legacy server that can already load and serve the Turducken can give clients a path to the new issuer with an ordinary renewal.

Who has to ship what

The work falls on different people at issuance, deployment, and verification.

The two CAs coordinate issuance. The alternate issuer needs the outer issuer’s fields before it authenticates its certificate. The classical CA needs the alternate issuer’s result before it signs its own. A CA that offers this through ACME could deliver the finished certificate at renewal.

On the client, the certificate verifier has to recognize the embedded data, reconstruct the alternate, and build a path to an issuer the client trusts. On the server, an existing TLS library may already be able to load and serve the outer certificate.

Certificate automation can keep writing the result to the same path. Operators still need to test that the service reloads it and that the clients they support handle the unfamiliar SCT entry.

Browsers and operating systems ship the post-quantum roots. Each client operator then picks the day to remove the classical ones.

Applications that authorize a peer by issuer or serial number need a closer look. In mutual TLS, for example, an application might inspect the certificate it received even though its library validated the alternate. Those certificates have different issuers and serial numbers. The application needs the verified path for that decision. A library API that returns only success or failure can’t tell it which certificate passed.

The draft is an individual submission at version 01. The LAMPS working group could take it up.

A server operator renews a certificate on Monday. A browser retires its classical roots on Tuesday. An older client still connects on Wednesday. Those three events landing on different days is how an Internet-wide migration gets done.

Embedded Alternate Issuer Certificates, IETF individual draft · Merkle Tree Certificates, IETF working-group draft

PKI & Certificates

Use ← and → to move through the timeline.