At this point it's pretty clear that I'll never remember the syntax for
opensll to show various information about a certificate.
go install fcuny.net/certcheck@latest
certcheck badssl.com
certcheck go run . -domain badssl.com -port 443 -format long
certcheck -domain self-signed.badssl.com -insecure -format long
certcheck -domain badssl.com -timeout 5s
certcheck -domain badssl.com -warn-days 14
certcheck -domain badssl.com -format json
-format accepts short (default), long, or json. The json format
prints a CertificateInfo document to stdout, useful for scripting instead
of parsing the text output.
-warn-days N (default 0, disabled) makes certcheck exit with status 2
instead of 0 when the certificate's remaining validity is N days or
fewer (including already expired). Status 1 is still reserved for hard
errors such as connection or parsing failures.
-version prints the version and the Go toolchain the binary was built
with, for example certcheck v0.1.0 built with go1.27.3. A build from a
checkout shows the commit instead, with +dirty if it had uncommitted
changes. The Go version matters because certificate trust fixes ship in the
toolchain, so an older binary may lack them until it is rebuilt.
Could the same be achieved with a wrapper around openssl ? yes.