trust

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package trust holds the root certificates used to validate the TLS endpoints and certificates we monitor.

It exists because Go's own escape hatch is a trap for this use case: SSL_CERT_FILE *replaces* the system bundle rather than extending it, so pointing it at an internal root silently drops every public CA — and when the file cannot be read, crypto/x509 returns an empty pool with a nil error, so every check fails as "unknown authority" with nothing in the logs. Operators running an internal PKI need to add a root, not swap the whole store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialInspect added in v1.5.0

func DialInspect(ctx context.Context, addr, serverName string, timeout time.Duration) (tls.ConnectionState, error)

DialInspect opens a TLS connection that accepts any certificate, so a chain can be reported even when it is invalid, and returns its state. DialInspect completes a TLS handshake that accepts any certificate and returns the connection state, without sending a single application byte.

func Load

func Load(path string) error

Load reads a PEM bundle and appends it to the system roots. Any failure is returned rather than swallowed: a misconfigured CA path must stop the process, not degrade every TLS check into a confusing "unknown authority".

func Pool

func Pool() *x509.CertPool

Pool returns the roots to validate against, or nil when no extra CA was loaded. Nil is meaningful: both tls.Config.RootCAs and x509.VerifyOptions.Roots read it as "use the system store", so an install without a custom CA keeps exactly the behaviour it had before this package existed.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL