Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogBundleUsage ¶
LogBundleUsage logs that a custom CA bundle is in use. It logs at most once.
func LogTrustReport ¶
LogTrustReport logs a structured TLS trust report once.
Types ¶
type Bundle ¶
type Bundle struct {
Path string
RootCAs *x509.CertPool
SystemTrust SystemTrustSummary
ExtraBundle *ExtraBundleSummary
}
Bundle contains a loaded PEM CA bundle and the derived RootCAs pool.
func LoadBundle ¶
LoadBundle reads the provided PEM file and returns a certificate pool that extends the system trust roots with the provided certificates.
type CertMetadata ¶
type CertMetadata struct {
CertID string `json:"cert_id"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
SubjectCN string `json:"subject_cn,omitempty"`
IssuerCN string `json:"issuer_cn,omitempty"`
NotBefore string `json:"not_before,omitempty"`
NotAfter string `json:"not_after,omitempty"`
Source string `json:"source,omitempty"`
ParseStatus string `json:"parse_status"`
}
CertMetadata captures metadata for a certificate.
type ClientCertificate ¶
type ClientCertificate struct {
CertPath string
KeyPath string
Certificate tls.Certificate
}
ClientCertificate contains a loaded client certificate/key pair used for outbound mTLS.
func LoadClientCertificate ¶
func LoadClientCertificate(certPath, keyPath string) (*ClientCertificate, error)
LoadClientCertificate loads and validates an mTLS client certificate/key pair. Both paths are required when either is set.
type ExtraBundleSummary ¶
type ExtraBundleSummary struct {
Path string `json:"path,omitempty"`
CertCount int `json:"cert_count"`
ParseErrors int `json:"parse_errors"`
Certificates []CertMetadata `json:"certificates,omitempty"`
}
ExtraBundleSummary describes the extra CA bundle.
type SystemTrustSummary ¶
type SystemTrustSummary struct {
Enabled bool `json:"enabled"`
Source string `json:"source"`
SourcePaths []string `json:"source_paths,omitempty"`
FallbackNote string `json:"fallback_note,omitempty"`
}
SystemTrustSummary describes system trust root usage.
type TrustReport ¶
type TrustReport struct {
SystemTrust SystemTrustSummary `json:"system_trust"`
ExtraBundle *ExtraBundleSummary `json:"extra_bundle,omitempty"`
}
TrustReport describes outbound TLS trust configuration.
func BuildTrustReport ¶
func BuildTrustReport(bundle *Bundle) TrustReport
BuildTrustReport returns trust metadata for logging and APIs.