y509 validate example.com:443 --json
{
"host": "example.com",
"trust": {
"level": "self-anchored",
"trusted": false,
"anchor": "Internal Root CA",
"error": "x509: certificate signed by unknown authority"
},
"presentation": {
"ok": false,
"findings": [
{
"problem": "missing issuer",
"subject": "*.example.com",
"fetchUrls": ["http://r13.i.lencr.org/"]
}
]
},
"chain": [{ "index": 0, "daysUntilExpiry": 43, "…": "…" }]
}
two checks worth wiring up
# Fail the build on a chain that verifies but is mis-served.
$ y509 validate example.com:443 --json | jq -e '.presentation.ok'
# Warn 30 days out, without parsing prose.
$ y509 validate example.com:443 --json | jq '.chain[0].daysUntilExpiry < 30'