pemfile

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package pemfile holds the checks shared by the inbound (internal/servertls) and outbound (internal/httpclient) TLS loaders for the PEM files named in configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendCertificates

func AppendCertificates(pool *x509.CertPool, data []byte) error

AppendCertificates adds every certificate in data to pool. Unlike AppendCertsFromPEM, it rejects a block that does not parse, so a bundle cannot silently drop one of its CAs. pem.Decode itself skips a block with bad framing or base64, so the decoded blocks are counted against the BEGIN markers. Like pem.Decode, only a marker that starts a line counts, so a comment that quotes one does not fail the bundle. Blocks of other types are skipped.

func CheckPath

func CheckPath(field, path string) error

CheckPath rejects PEM contents given where a file path belongs, as with SERVER_TLS_KEY_FILE="$(cat tls.key)" or a ${file:...} reference, which resolves to the file's contents. The error names only the field: an *fs.PathError would echo the whole value, writing a private key to the logs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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