Run y509 validate on three copies of one certificate chain from this repository: one that leaves out the intermediate, one that sends it before the leaf, and one that is correct. You will see which one fails, why, and how to make a script fail on the chain that verifies but is served in the wrong order. It works offline. You need y509, git and jq.
Install
Section titled “Install”Homebrew
brew install kanywst/tap/y509Go
Needs Go 1.27.4 or later (the go line in go.mod). Installs to $(go env GOPATH)/bin.
go install github.com/dyokto/y509/cmd/y509@latestLinux and macOS binary
Pick the archive for your platform from the releases page: darwin-arm64, darwin-amd64, linux-amd64 or linux-arm64.
gh release download -R dyokto/y509 -p 'y509-*-linux-amd64.tar.gz'tar xzf y509-*-linux-amd64.tar.gz y509sudo install y509 /usr/local/bin/Debian and Ubuntu
gh release download -R dyokto/y509 -p 'y509_*_linux_amd64.deb'sudo apt install ./y509_*_linux_amd64.debFedora and RHEL
gh release download -R dyokto/y509 -p 'y509_*_linux_amd64.rpm'sudo dnf install ./y509_*_linux_amd64.rpmWindows
scoop bucket add kanywst https://github.com/kanywst/scoop-bucketscoop install kanywst/y509The releases page also has windows-amd64 and windows-arm64 zip archives.
FreeBSD
pkg install y509Check it is on your PATH:
$ y509 versiony509 version 1.18.0Build: 1.18.0 (28555f8) built on 2026-12-03T13:12:47ZA go install build prints the module version with a v in front.
Get the example chain
Section titled “Get the example chain”scripts/gen_quickstart_certs.go makes a root, an intermediate and a leaf for www.example.test in testdata/quickstart/, valid from now: the CAs for a year, the leaf for 90 days. It needs Go. The root is not in your system trust store, so every command passes it with --roots.
git clone --depth 1 https://github.com/dyokto/y509cd y509make quickstart-certsA chain without its intermediate
Section titled “A chain without its intermediate”leaf-only.pem holds the leaf and nothing else, as a server does when it is configured with the certificate file instead of the full chain. A browser fetches the intermediate from the leaf's AIA URL and connects; curl, Go and Java do not.
$ y509 validate testdata/quickstart/leaf-only.pem --roots testdata/quickstart/root.pem❌ Certificate chain is broken.
x509: certificate signed by unknown authority
Chain as presented: • missing issuer: www.example.test the chain stops at a certificate that is not a CA; its issuer "y509 Quick Start Intermediate" was never sent, so a client that does not chase AIA (curl, Go, Java) cannot build a chain fetch from: http://ca.example.test/intermediate.cercertificate chain is brokenThe exit status is 1. The last line is on stderr.
A chain in the wrong order
Section titled “A chain in the wrong order”wrong-order.pem has both certificates, intermediate first. It verifies, so validate exits 0, and still reports how it was served:
$ y509 validate testdata/quickstart/wrong-order.pem --roots testdata/quickstart/root.pem✅ Certificate chain is valid.Trust anchor: y509 Quick Start Root
Chain as presented: • out of order: y509 Quick Start Intermediate the certificates were not sent leaf-first; RFC 8446 asks for leaf-first order and some embedded TLS stacks require itThe exit status cannot carry that finding. To fail a script or a CI job on it, read presentation.ok from the JSON output:
$ y509 validate testdata/quickstart/wrong-order.pem --roots testdata/quickstart/root.pem --json | jq -e '.presentation.ok'falsejq -e exits 1 on false.
The fixed chain
Section titled “The fixed chain”chain.pem sends the leaf, then the intermediate:
$ y509 validate testdata/quickstart/chain.pem --roots testdata/quickstart/root.pem✅ Certificate chain is valid.Trust anchor: y509 Quick Start Root$ y509 validate testdata/quickstart/chain.pem --roots testdata/quickstart/root.pem --json | jq -e '.presentation.ok'trueBoth exit 0. Against a live server the same commands take host:port instead of a file, and validate also checks the host name.
Open it in the TUI
Section titled “Open it in the TUI”Without a subcommand, y509 opens the chain in the terminal UI: the certificates in the order they were sent, and a details pane with tabs. v validates, ? lists the keys, q quits. This step needs a terminal, so CI does not run it.
y509 testdata/quickstart/chain.pem
Verify a release
Section titled “Verify a release”Each release has a checksums.txt signed keylessly with cosign, an SPDX SBOM per archive, and SLSA build provenance. For releases before v1.17.1, see Verifying releases.
$ gh release download v1.18.0 -R dyokto/y509 -p '*-checksums.txt*' -p 'y509-1.18.0-linux-amd64.tar.gz'$ cosign verify-blob \ --bundle y509-1.18.0-checksums.txt.sigstore.json \ --certificate-identity-regexp '^https://github.com/dyokto/y509/\.github/workflows/release\.yml@refs/tags/v' \ --certificate-oidc-issuer https://token.actions.githubusercontent.com \ y509-1.18.0-checksums.txtVerified OK$ sha256sum --ignore-missing -c y509-1.18.0-checksums.txty509-1.18.0-linux-amd64.tar.gz: OK$ gh attestation verify y509-1.18.0-linux-amd64.tar.gz -R dyokto/y509- Validating from a script: exit codes,
--policy fips|pqc,--check-crl, and every finding about how a chain was served - Machine-readable output: each field of
--jsonand thejqchecks to gate on - GitHub Actions: the same checks in a workflow, with
fail-on - Usage: files, live servers, STARTTLS,
diffandinventory
© 2026 The y509 Authors. Licensed under Apache-2.0. Part of dyokto.