Documentation
¶
Overview ¶
Package mitm provides an in-process TLS certificate authority for HTTPS interception (man-in-the-middle). It issues and caches leaf certificates on demand, signed by a configurable root CA.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveCA ¶
SaveCA writes the CA certificate and key to PEM files. The certificate is written world-readable (0644) — it's public material — and the private key is written owner-read-only (0600). If either file already existed with looser permissions, os.OpenFile with O_CREATE leaves the existing mode alone, so we explicitly Chmod the key file at the end.
Types ¶
type Authority ¶
type Authority struct {
// contains filtered or unexported fields
}
Authority holds the proxy's root CA and issues leaf certificates on demand for each HTTPS host.
func New ¶
New loads (or generates) a root CA from the given PEM files. If both paths are empty a temporary in-memory CA is generated — clients will see TLS errors unless they install the printed certificate.