This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
TLSX is a Go-based TLS data gathering and analysis toolkit focused on TLS connection testing, certificate analysis, and security assessment. It's part of the ProjectDiscovery ecosystem and supports multiple TLS connection modes, fingerprinting, and misconfiguration detection.
- Build:
make buildorgo build -v -ldflags '-s -w' -o "tlsx" cmd/tlsx/main.go - Test:
make testorgo test -v ./... - Tidy dependencies:
make tidyorgo mod tidy - Run single test:
go test -v ./path/to/specific/package -run TestName - Main executable: Built as
./tlsxbinary
- Entry point:
cmd/tlsx/main.go- CLI application entry with flag parsing - Runner package:
internal/runner/- Orchestrates the execution flow, handles input processing and output coordination - Core TLS package:
pkg/tlsx/- Contains the main TLS analysis logic and connection handling
The toolkit supports multiple TLS connection backends:
- auto mode (default): Automatic fallback between connection modes for maximum compatibility
- ctls: Uses Go's standard
crypto/tlslibrary - ztls: Uses ZMap's zcrypto TLS implementation for older TLS versions and advanced analysis
- openssl: Uses external OpenSSL binary for specialized operations
Implementation in pkg/tlsx/:
auto/- Auto-detection and fallback logictls/- Standard Go crypto/tls implementationztls/- ZMap zcrypto implementation with JA3 fingerprintingopenssl/- OpenSSL binary integration
- Client abstraction:
pkg/tlsx/clients/- Unified interface for different TLS connection modes - Certificate Transparency:
pkg/ctlogs/- Streaming CT logs support for real-time certificate monitoring - Output handling:
pkg/output/- JSON/text output formatting and file writing - Fingerprinting:
pkg/tlsx/jarm/- JARM TLS fingerprintingpkg/tlsx/ztls/ja3/- JA3 client fingerprinting
- Test files follow Go convention:
*_test.go - Unit tests in each package test specific functionality
- Integration tests in
internal/runner/runner_test.go - OpenSSL functionality tested in
pkg/tlsx/openssl/openssl_test.go
- Multi-mode TLS scanning: Supports different TLS libraries for comprehensive compatibility
- Certificate analysis: Extract SANs, CNs, detect misconfigurations (expired, self-signed, mismatched, revoked, untrusted)
- TLS fingerprinting: JARM and JA3 fingerprint generation
- CT logs streaming: Real-time certificate transparency log monitoring
- Flexible input: Supports ASN, CIDR, IP, hostname, and URL inputs
- Multiple output formats: Standard text and JSON output
- Go version: Requires Go 1.24+
- Dependencies: Heavy use of ProjectDiscovery libraries (dnsx, fastdialer, goflags, gologger)
- External tools: Optional OpenSSL binary for specialized TLS operations
- Concurrency: Built-in support for concurrent TLS connections with configurable limits
- Error handling: Uses ProjectDiscovery's utils/errors for consistent error handling patterns
assets/- Embedded data (cipher status, root certificates)cmd/- Command-line applications and utilitiesexamples/- Usage examples including CT logs streaminginternal/runner/- Core execution logic, not for external usepkg/- Public API packages for library usage