tlsfiles

package
v0.3.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package tlsfiles loads the configured TLS identity and trust roots of a daemon, and refuses at startup what would fail every handshake later. Each error names the configuration key an operator has to correct.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyPair

func KeyPair(certField, certFile, keyField, keyFile string, now time.Time) (tls.Certificate, error)

KeyPair loads a certificate and its key, and refuses a certificate outside its validity window: an expired or not yet valid identity fails every handshake, so it is reported once here instead of as an unexplained rejection per connection. certField and keyField are the configuration keys that name the two files.

func TrustRoots

func TrustRoots(field, path string, now time.Time) (*x509.CertPool, error)

TrustRoots reads an authority file and refuses one that cannot verify anything: a file holding no certificate, a certificate that does not parse, and a root outside its validity window, which would fail every chain built on it. A file may hold several roots, which is what an authority rotation needs while old and new leaves are both in use.

Types

This section is empty.

Jump to

Keyboard shortcuts

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