https://github.com/linkdata/certstream
Certificate Transparency Log library
https://github.com/linkdata/certstream
Last synced: about 1 month ago
JSON representation
Certificate Transparency Log library
- Host: GitHub
- URL: https://github.com/linkdata/certstream
- Owner: linkdata
- License: mit
- Created: 2024-10-16T06:51:33.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-02-05T13:15:24.000Z (about 2 months ago)
- Last Synced: 2026-02-05T19:55:06.945Z (about 2 months ago)
- Language: Go
- Size: 1.09 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/linkdata/certstream/actions/workflows/go.yml)
[](https://htmlpreview.github.io/?https://github.com/linkdata/certstream/blob/coverage/main/report.html)
[](https://goreportcard.com/report/github.com/linkdata/certstream)
[](https://godoc.org/github.com/linkdata/certstream)
# CertStream
Small library wrapping github.com/google/certificate-transparency-go and github.com/FiloSottile/sunlight.
Requires a Postgres database to use.
```go
func grabdata() {
fulllimiter := bwlimit.NewLimiter()
fulldialer := fulllimiter.Wrap(nil)
var filllimiter *bwlimit.Limiter
var filldialer proxy.ContextDialer
cfg := certstream.NewConfig()
cfg.Logger = slog.Default()
cfg.PgUser = "username"
cfg.PgPass = "password"
cfg.PgName = "certstream"
cfg.PgAddr = "127.0.0.1:5432"
cfg.HeadDialer = fulldialer
filllimiter = bwlimit.NewLimiter(int64(1 * 1024 * 1024))
filldialer = filllimiter.Wrap(fulldialer)
cfg.TailDialer = filldialer
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
var wg sync.WaitGroup
cs, err := certstream.Start(ctx, &wg, cfg)
defer wg.Wait()
if err != nil {
panic(err)
} else {
for le := range cs.C {
fmt.Printf("%q %v %v\n", le.Domain, le.Historical, le.Cert().DNSNames)
}
}
}
```