GitHub
Certificate transparency · streamed

Certificate Transparency streaming, written in Rust.

Reads newly issued SSL/TLS certificates from Chrome- and Apple-trusted Certificate Transparency logs and streams them over WebSocket or Server-Sent Events. Both RFC 6962 and static-ct-api logs are supported, in a single binary.

v1.5.6·MIT· RFC 6962·static-CT-API· WebSocket & SSE·single binary
docker run -d -p 8080:8080 ghcr.io/reloading01/certstream-server-rust:latest
Features

What the server does.

WebSocket and SSE

Certificate updates can be consumed over WebSocket or Server-Sent Events. Both transports carry the same certificate stream.

RFC 6962 and static-ct-api

The server watches both classic get-entries logs and newer static-ct-api logs based on checkpoints and tiles. Both types run in the same process.

Cross-log deduplication

The same certificate is often submitted to several CT logs. Certificates are deduplicated by SHA-256 before broadcast, so clients receive one update per certificate within the configured deduplication window.

State persistence

Watcher positions can be written to disk and restored after a restart, so each log does not start from scratch after a restart or upgrade.

Connection limits

Optional limits can be applied to the total connection count and per IP address.

Token authentication

Bearer-token authentication can be enabled for client connections. Tokens are compared in constant time, and multiple tokens and a custom header name are supported.

Configuration reload

The configuration file can be watched for changes, so supported settings can be updated without restarting the process.

Log health

Each CT log is tracked independently. Repeated failures move a watcher through healthy, degraded, and unhealthy, with retries and exponential backoff behind a per-log circuit breaker.

Metrics and REST API

Prometheus metrics are exposed at /metrics. An optional REST API serves server statistics, CT log status, and certificate lookup.

Compatibility

Existing certstream clients.

The certificate message format follows the one used by Calidog's certstream-server and certstream-server-go, so a client only needs a different WebSocket address.

Python certstream library
import certstream

certstream.listen_for_events(callback,
    url='wss://your-host:8080/')
Anything else plain WebSocket
# same certificate_update messages,
# same all_domains, same leaf_cert
wscat -c wss://your-host:8080/

Message types, field names and the leaf_cert shape are unchanged, so a parser written against either predecessor keeps working. This implementation additionally reads static-ct-api logs and deduplicates certificates seen across several logs. If only domain names are needed, the /domains-only stream sends roughly 100 to 500 bytes per message instead of the 2 to 5 KB of the default stream.

Performance

Measured throughput.

A two-hour run against all 45 Chrome- and Apple-trusted logs, with the default configuration and one subscriber on the domains-only stream. Metrics were sampled every 30 seconds.

420/s
Certificates ingested, median. 796/s at p95
722/s
Domain names, 62 million a day
80MB
Resident memory, steady state. 50 MB allocated
0.2core
CPU, median

At the measured median that is about 36 million certificate updates a day. Each certificate is serialized once and shared with every subscriber through an Arc<PreSerializedMessage>, and serialization is skipped when no client is connected. The memory behaviour is described in 358 MB resident, 52 MB in use.

Blog

Engineering notes.

Support

Supporting the project.

certstream-server-rust is developed in my spare time and released under the MIT license. If you find it useful, starring the repository, reporting issues, or sharing it with someone who needs it is appreciated.

GitHub Sponsors is also available for anyone who wants to support development.

Sponsor on GitHub