Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CAManager ¶
type CAManager struct {
CADir string
CACert *x509.Certificate
CAKey crypto.PrivateKey
}
CAManager generates and manages a local CA certificate used for TLS interception.
func NewCAManager ¶
NewCAManager creates a CAManager for the given directory and ensures the CA certificate and key are available (generating them if necessary).
func (*CAManager) GenerateServerCert ¶
func (m *CAManager) GenerateServerCert(host string) (*tls.Certificate, error)
GenerateServerCert creates a TLS leaf certificate for the given hostname, signed by the CA. The returned *tls.Certificate is ready for use in a tls.Config.
func (*CAManager) GetOrCreateCA ¶
GetOrCreateCA loads an existing CA cert and key from disk, or generates new ones if they do not exist.
Click to show internal directories.
Click to hide internal directories.