Go tool to check how many days till the expiration of a website certificate
-
Install Go (1.19 or later)
-
Clone this repository
-
Run the tool:
go run main.go -url https://example.com
go run main.go -url <https-url>-url: Https URL which certification expiration will be checked. Required
# Check Google's certificate
go run main.go -url https://google.com
# Check GitHub's certificate
go run main.go -url https://github.com
# Test it on a custom port
go run main.go -url https://example.com:1234# Build with SBOM
docker build --sbom=true -t cert-expiration .
# Or build without SBOM
docker build -t cert-expiration .# Check Google's certificate
docker run --rm cert-expiration -url https://google.com
# Check GitHub's certificate
docker run --rm cert-expiration -url https://github.com
# Check any HTTPS site
docker run --rm cert-expiration -url https://example.comThe project uses GitHub Actions for automated testing and releases:
- On push to main: Runs tests, generates semantic version tags, and publishes Docker images
- Semantic versioning: Based on conventional commits
feat:→ minor version bumpfix:→ patch version bumpBREAKING CHANGE:→ major version bump
- Container images: Published to
ghcr.iowith SBOM
# Use latest version
docker run --rm ghcr.io/your-username/cert-expiration:latest -url https://google.com
# Use specific version
docker run --rm ghcr.io/your-username/cert-expiration:v1.0.0 -url https://google.comRun the unit tests:
# Run all tests
go test ./test
# Run tests with verbose output
go test -v ./test
# Run tests with coverage
go test -cover ./test