tlsutil

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: EUPL-1.2 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTLSConfig

func CreateTLSConfig(cfg Config) (*tls.Config, error)

CreateTLSConfig creates a TLS configuration with client certificate and optional CA

func LoadCACertPool

func LoadCACertPool(caFile string) (*x509.CertPool, error)

LoadCACertPool loads CA certificates from file

func LoadClientCertificate

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

LoadClientCertificate loads a client certificate from PEM or PKCS#12 file

Types

type Config

type Config struct {
	// TLSCertFile is the PEM certificate file OR .p12/.pfx file
	TLSCertFile string `koanf:"tlscertfile"`
	// TLSKeyFile is the PEM key file (not used if TLSCertFile is .p12/.pfx)
	TLSKeyFile string `koanf:"tlskeyfile"`
	// TLSKeyPassword is the password for encrypted key or .p12/.pfx file
	TLSKeyPassword string `koanf:"tlskeypassword"`
	// TLSCAFile is the CA certificate file (or bundle) used to verify server/peer certificates
	TLSCAFile string `koanf:"tlscafile"`
}

Jump to

Keyboard shortcuts

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