certificates

package
v2.1.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

A Manager manages TLS certificates.

func NewManager

func NewManager(dir string, hostKey types.PrivateKey, opts ...ManagerOpt) (*Manager, error)

NewManager creates a new Manager.

func (*Manager) Close

func (m *Manager) Close() error

Close closes the Manager.

func (*Manager) GetCertificate

func (m *Manager) GetCertificate(*tls.ClientHelloInfo) (*tls.Certificate, error)

GetCertificate returns the TLS certificate for the given ClientHelloInfo. It implements the tls.Config.GetCertificate method.

type ManagerOpt

type ManagerOpt func(*Manager)

A ManagerOpt sets options for a certificate Manager.

func WithLocalCert

func WithLocalCert(certFile, keyFile string) ManagerOpt

WithLocalCert sets the certificate and key files for the Manager.

func WithLog

func WithLog(log *zap.Logger) ManagerOpt

WithLog sets the logger for the Manager.

Jump to

Keyboard shortcuts

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