<!-- Generated by website/scripts/sync-docs.mjs from docs/quickstart.md. Edit that file, not this one. -->

# Quick start

> Every page of this site: https://dyokto.github.io/y509/docs/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`.

## Install



**Homebrew**

```sh
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`.

```sh
go install github.com/dyokto/y509/cmd/y509@latest
```

**Linux and macOS binary**

Pick the archive for your platform from the [releases page](https://github.com/dyokto/y509/releases): `darwin-arm64`, `darwin-amd64`, `linux-amd64` or `linux-arm64`.

```sh
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**

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

**Fedora and RHEL**

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

**Windows**

```powershell
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**

```sh
pkg install y509
```



Check it is on your `PATH`:

```console
$ 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.

## Get the example chain

[`scripts/gen_quickstart_certs.go`](https://github.com/dyokto/y509/blob/main/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`.

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

## 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.

```console
$ 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.

## 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:

```console
$ 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:

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

`jq -e` exits `1` on `false`.

## The fixed chain

`chain.pem` sends the leaf, then the intermediate:

```console
$ 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.

## 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.

```sh
y509 testdata/quickstart/chain.pem
```

<img src="https://github.com/dyokto/y509/raw/main/demo.gif" alt="y509 TUI showing a certificate chain and its details tabs">

## 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](https://dyokto.github.io/y509/docs/verify-releases/).

```console
$ 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
```

## Next

- [Validating from a script](https://dyokto.github.io/y509/docs/validate/): exit codes, `--policy fips|pqc`, `--check-crl`, and every finding about how a chain was served
- [Machine-readable output](https://dyokto.github.io/y509/docs/json/): each field of `--json` and the `jq` checks to gate on
- [GitHub Actions](https://dyokto.github.io/y509/docs/github-action/): the same checks in a workflow, with `fail-on`
- [Usage](https://dyokto.github.io/y509/docs/usage/): files, live servers, STARTTLS, `diff` and `inventory`
