Skip to content

Quick start

Markdown · llms.txt

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.

Homebrew

Terminal window
brew install kanywst/tap/y509

Go

Needs Go 1.27.4 or later (the go line in go.mod). Installs to $(go env GOPATH)/bin.

Terminal window
go install github.com/dyokto/y509/cmd/y509@latest

Linux and macOS binary

Pick the archive for your platform from the releases page: darwin-arm64, darwin-amd64, linux-amd64 or linux-arm64.

Terminal window
gh release download -R dyokto/y509 -p 'y509-*-linux-amd64.tar.gz'
tar xzf y509-*-linux-amd64.tar.gz y509
sudo install y509 /usr/local/bin/

Debian and Ubuntu

Terminal window
gh release download -R dyokto/y509 -p 'y509_*_linux_amd64.deb'
sudo apt install ./y509_*_linux_amd64.deb

Fedora and RHEL

Terminal window
gh release download -R dyokto/y509 -p 'y509_*_linux_amd64.rpm'
sudo dnf install ./y509_*_linux_amd64.rpm

Windows

Terminal window
scoop bucket add kanywst https://github.com/kanywst/scoop-bucket
scoop install kanywst/y509

The releases page also has windows-amd64 and windows-arm64 zip archives.

FreeBSD

Terminal window
pkg install y509

Check it is on your PATH:

Terminal window
$ y509 version
y509 version 1.18.0
Build: 1.18.0 (28555f8) built on 2026-12-03T13:12:47Z

A go install build prints the module version with a v in front.

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.

Terminal window
git clone --depth 1 https://github.com/dyokto/y509
cd y509
make quickstart-certs

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.

Terminal window
$ 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.cer
certificate chain is broken

The exit status is 1. The last line is on stderr.

wrong-order.pem has both certificates, intermediate first. It verifies, so validate exits 0, and still reports how it was served:

Terminal window
$ 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 it

The exit status cannot carry that finding. To fail a script or a CI job on it, read presentation.ok from the JSON output:

Terminal window
$ y509 validate testdata/quickstart/wrong-order.pem --roots testdata/quickstart/root.pem --json | jq -e '.presentation.ok'
false

jq -e exits 1 on false.

chain.pem sends the leaf, then the intermediate:

Terminal window
$ 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'
true

Both exit 0. Against a live server the same commands take host:port instead of a file, and validate also checks the host name.

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.

Terminal window
y509 testdata/quickstart/chain.pem
y509 TUI showing a certificate chain and its details tabs

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.

Terminal window
$ 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.txt
Verified OK
$ sha256sum --ignore-missing -c y509-1.18.0-checksums.txt
y509-1.18.0-linux-amd64.tar.gz: OK
$ gh attestation verify y509-1.18.0-linux-amd64.tar.gz -R dyokto/y509