server

package
v0.0.0-...-64f20d1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChallengeTypeDns01 string = "dns01"
)

Variables

View Source
var ACMEAccountKey crypto.PrivateKey
View Source
var Config = &config.ServerConfigT{}
View Source
var ServerCertCache = ServerCertCacheT{}
View Source
var UpdateCacheFileChan = make(chan *ServerCacheFileEntry, 1)

Functions

func ACMEProviderSupported

func ACMEProviderSupported(provider string) bool

func HttpSrv

func HttpSrv()

func InitACMEAccount

func InitACMEAccount() error

func InitCache

func InitCache() error

func RegisterAccount

func RegisterAccount(ACMEProvider, Email, Kid, Hmac string) error

func SetChallenger

func SetChallenger(legoCfg *lego.Config, instance *ACME, p config.DnsProvider) error

Types

type ACME

type ACME struct {
	Registration *registration.Resource
	Client       *lego.Client
	// contains filtered or unexported fields
}

func MakeACME

func MakeACME() (*ACME, error)

func (*ACME) GetEmail

func (a *ACME) GetEmail() string

func (*ACME) GetPrivateKey

func (a *ACME) GetPrivateKey() crypto.PrivateKey

func (*ACME) GetRegistration

func (a *ACME) GetRegistration() *registration.Resource

func (*ACME) Obtain

func (a *ACME) Obtain(domains []string, deadline time.Time) (fullchain, key []byte, err error)

func (*ACME) RetryObtain

func (a *ACME) RetryObtain(domains []string, deadline time.Time) (fullchain, key []byte, err error)

type CertT

type CertT struct {
	FullChain   []byte    `json:"fullChain"`
	Key         []byte    `json:"key"`
	ValidBefore time.Time `json:"validBefore"`
}

func (*CertT) IsValid

func (c *CertT) IsValid() bool

type MyUser

type MyUser struct {
	Email        string
	Registration *registration.Resource
	Key          crypto.PrivateKey
}

func (*MyUser) GetEmail

func (u *MyUser) GetEmail() string

func (*MyUser) GetPrivateKey

func (u *MyUser) GetPrivateKey() crypto.PrivateKey

func (*MyUser) GetRegistration

func (u *MyUser) GetRegistration() *registration.Resource

type ServerCacheFile

type ServerCacheFile []*ServerCacheFileEntry

func (*ServerCacheFile) GetIndex

func (s *ServerCacheFile) GetIndex(domains []string) int

type ServerCacheFileEntry

type ServerCacheFileEntry struct {
	Domains []string `json:"domains"`
	Cert    CertT    `json:"cert"`
}

type ServerCertCacheEntry

type ServerCertCacheEntry struct {
	Listening atomic.Bool
	Updated   atomic.Pointer[chan struct{}]
	Stop      atomic.Pointer[chan struct{}]
	// contains filtered or unexported fields
}

func (*ServerCertCacheEntry) Cert

func (c *ServerCertCacheEntry) Cert() CertT

func (*ServerCertCacheEntry) CertWatchDog

func (c *ServerCertCacheEntry) CertWatchDog()

func (*ServerCertCacheEntry) Renew

func (c *ServerCertCacheEntry) Renew(retry bool) (bool, error)

type ServerCertCacheT

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

func (*ServerCertCacheT) GetEntry

func (s *ServerCertCacheT) GetEntry(domains []string) *ServerCertCacheEntry

Jump to

Keyboard shortcuts

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