go install github.com/ochko/go-tls-check/cmd/tls-check
tls-check example.com
tls-check -w 24h -t 5s example.com
Exit code is 0
when validation was successful, 1
if there is any issue.
It also prints some information in json format, so that you can collect expiration days of your deployed certificates:
{
"status": "ok",
"host": "example.com",
"expiration": "32h1m52s",
}
When there is an issue:
{
"status": "ng",
"host":"unknown.com",
"expiration":"0s",
"msg":"dial tcp 23.253.58.227:443: i/o timeout"
}
tls-cert-check [options] hostname1 hostname2 ...
options:
-t string
Connection timeout. (default "10s")
-w string
Allowd time before certificate expiration. (default "72h")
import "github.com/ochko/go-tls-check/validator"
...
expiration, err := validator.Check("example.com", time.Hour*24, time.Second*3)
...
docker build . -t tls-check
docker run tls-check example.com
MIT