tlsutil

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 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(certFile, keyFile, password, caFile string) (*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 {
	// CertFile is the path to a PEM certificate file OR .p12/.pfx file
	CertFile string
	// KeyFile is the path to a PEM key file (not used if CertFile is .p12/.pfx)
	KeyFile string
	// Password is the password for encrypted key or .p12/.pfx file
	Password string
	// CAFile is the path to a CA certificate file to verify server
	CAFile string
}

Config holds TLS configuration options

Jump to

Keyboard shortcuts

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