trust

package
v1.16.2-0...-82d92f0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadClientCertificate

func LoadClientCertificate(certFile, keyFile string) (*tls.Certificate, error)

LoadClientCertificate loads a client certificate and private key for mutual TLS authentication

func LoadPool

func LoadPool(opts Options) (*x509.CertPool, error)

LoadPool creates a certificate pool with system roots plus optional extras

func NewHTTP

func NewHTTP(pool *x509.CertPool, clientCert *tls.Certificate, minTLS uint16, timeout time.Duration) (*http.Client, context.Context)

NewHTTP creates an HTTP client with the given certificate pool, client cert, and TLS settings The timeout parameter is ignored - timeouts should be controlled per-request via context

Types

type Options

type Options struct {
	CACertFile     string        // Path to PEM bundle file
	CACertDir      string        // Directory containing *.pem or *.crt files
	ClientCertFile string        // Path to client certificate file
	ClientKeyFile  string        // Path to client certificate private key file
	Timeout        time.Duration // HTTP client timeout
	MinTLS         uint16        // Minimum TLS version
}

Options configures certificate loading and HTTP client behavior

Jump to

Keyboard shortcuts

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