Certificate formats · 19.8
Standard order of the chain
TLS 1.3 (RFC 8446, section 4.4.2) specifies the order that every client expects: the leaf certificate first, then the intermediates, each certifying the one before it. The root is normally omitted: the client already has it in its root store, and a root sent by the server is not trusted anyway. Sending it only makes every handshake larger. TLSPilot therefore writes the leaf first and the root only if you switch on Include root.
A PFX always contains the leaf first, followed by the intermediates and, with Include root, the root. TLSPilot never reverses a PFX: the systems that import it expect the certificate of the server first, and no target needs another order in a PKCS #12 file, so the option has no effect there. When it builds a PFX with chain, TLSPilot first matches the private key to the leaf. If the private key or the leaf is missing, or the PFX cannot be built, TLSPilot stops with the error PFX export could not build the certificate chain. The file was not written. No incomplete PFX is written. Solution: chapter Deployment targets.