https://github.com/ochko/go-tls-check
Utility for SSL/TLS certificate validation
https://github.com/ochko/go-tls-check
Last synced: 3 months ago
JSON representation
Utility for SSL/TLS certificate validation
- Host: GitHub
- URL: https://github.com/ochko/go-tls-check
- Owner: ochko
- Created: 2021-02-23T11:05:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-01-07T05:43:01.000Z (over 4 years ago)
- Last Synced: 2025-01-19T10:28:38.578Z (over 1 year ago)
- Language: Go
- Size: 28.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### SSL/TLS certificate validator
#### Use binary
```sh
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:
```json
{
"status": "ok",
"host": "example.com",
"expiration": "32h1m52s",
}
```
When there is an issue:
```json
{
"status": "ng",
"host":"unknown.com",
"expiration":"0s",
"msg":"dial tcp 23.253.58.227:443: i/o timeout"
}
```
#### Options
```
tls-cert-check [options] hostname1 hostname2 ...
options:
-t string
Connection timeout. (default "10s")
-w string
Allowd time before certificate expiration. (default "72h")
```
### Importing the package
```golang
import "github.com/ochko/go-tls-check/validator"
...
expiration, err := validator.Check("example.com", time.Hour*24, time.Second*3)
...
```
### Using the docker image
```sh
docker build . -t tls-check
docker run tls-check example.com
```
### License
MIT