certs

package
v0.0.0-...-4e12403 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCertExpired  = errors.New("Certificate expired")
	ErrCertNotFound = errors.New("Certificate not found")
)
View Source
var (
	ErrCacheKeyNotFound = errors.New("Key not found")
)

Functions

This section is empty.

Types

type Certs

type Certs struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(cfg *Config) *Certs

func (*Certs) Delete

func (c *Certs) Delete(cert *tls.Certificate) error

func (*Certs) Get

func (c *Certs) Get(domain string) (cert *tls.Certificate, err error)

Get gets a valid Certificate struct from a domain name

func (*Certs) GetCertificate

func (c *Certs) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)

func (*Certs) HTTPChallengeHandler

func (c *Certs) HTTPChallengeHandler(h http.Handler) http.Handler

func (*Certs) LoadCertsFromConfig

func (c *Certs) LoadCertsFromConfig(pems []PEMCert)

func (*Certs) Reload

func (c *Certs) Reload(cfg *Config)

func (*Certs) Store

func (c *Certs) Store(cert tls.Certificate) error

func (*Certs) TLSConfig

func (c *Certs) TLSConfig() *tls.Config

type Config

type Config struct {
	CA             string
	Email          string
	PEM            []PEMCert
	EtcdEndpoints  []string
	AltHTTPPort    int
	AltTLSALPNPort int
}

type PEMCert

type PEMCert struct {
	Domains string
	Key     string
	Cert    string
}

type Storage

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

func (*Storage) Delete

func (s *Storage) Delete(key string) (err error)

func (*Storage) Exists

func (s *Storage) Exists(key string) bool

func (*Storage) List

func (s *Storage) List(prefix string, recursive bool) ([]string, error)

func (*Storage) Load

func (s *Storage) Load(key string) ([]byte, error)

func (*Storage) Lock

func (s *Storage) Lock(key string) (err error)

Lock the underline etcd session key based

func (*Storage) Stat

func (s *Storage) Stat(key string) (certmagic.KeyInfo, error)

Stat returns information about key.

func (*Storage) Store

func (s *Storage) Store(key string, value []byte) (err error)

func (*Storage) Unlock

func (s *Storage) Unlock(key string) (err error)

Unlock the underline etcd session key based

Jump to

Keyboard shortcuts

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