y509 cert-chain.pem # a file (PEM, DER or PKCS#7)y509 example.com:443 # a live servery509 smtp.example.com:587 --starttls smtp # ...behind STARTTLScat chain.pem | y509 # stdinkubectl get secret tls -o json | y509 # a Kubernetes TLS secretPKCS#7 (.p7b, .p7c), PKCS#12 (.p12, .pfx) and Kubernetes TLS secrets are detected by content, so pipes work too. A secret is read from tls.crt, then ca.crt.
PKCS#12 is tried without a password first. If one is needed, it comes from Y509_PKCS12_PASSWORD, --password-file, or a prompt. Never a flag, since flags show up in ps. Private keys are ignored.
Live servers
Section titled “Live servers”y509 example.com:443y509 --connect 10.0.0.1:8443 --servername api.internaly509 db.example.com:5432 --starttls postgresy509 ldap.example.com:389 --starttls ldapy509 db.example.com:3306 --starttls mysqlAn existing file path is read as a file; anything else is an address. --connect forces an address. --starttls supports smtp, lmtp, imap, nntp, ftp, ldap, mysql and postgres (aliases: mariadb, postgresql).
The TUI handshake verifies nothing on purpose, so you can inspect a broken chain. Certificates are shown in the order the server sent them.
Comparing two chains
Section titled “Comparing two chains”y509 diff before.pem after.pemy509 diff node1.example.com:443 node2.example.com:443Chain differences: - leaf.example.com + leaf.example.com Example Intermediate CA
The leaf was replaced: • serial: 8149... -> 9e2c... • not after: 2026-09-30 -> 2026-12-29 • dns names: example.com -> example.com, www.example.comCertificates are matched by SHA-256 of their DER, not by subject, since a renewal keeps the name. Exit 0 if identical, 1 if different, like diff(1). Useful for spotting a rotation, or two CDN nodes serving different chains.
Taking an inventory
Section titled “Taking an inventory”inventory lists what you have, without verifying anything. It exits 0 for anything it could read:
y509 inventory www.example.com:443 api.example.com:443y509 inventory chain.pem --csv > inventory.csvTARGET SUBJECT KEY SIGNATURE EXPIRES DAYSwww.example.com:443 www.example.com ECDSA 256 ECDSA-SHA256 2026-11-02 49www.example.com:443 R11 RSA 2048 SHA256-RSA 2027-03-12 179Good for PCI DSS 4.0.1 inventories or finding RSA keys ahead of a post-quantum migration. --json adds fingerprints and lifetimes.
© 2026 The y509 Authors. Licensed under Apache-2.0. Part of dyokto.