Documentation
¶
Index ¶
- func BootstrapEnv(logger *ll.Logger) error
- func IsCARootInstalled(certDir expect.Folder) bool
- type ACMEProvider
- type AcmeUser
- type ChallengeStore
- func (s *ChallengeStore) CleanUp(domain, token, keyAuth string) error
- func (s *ChallengeStore) GetKeyAuth(token string) (string, bool)
- func (s *ChallengeStore) Present(domain, token, keyAuth string) error
- func (s *ChallengeStore) SetCluster(c ClusterBroadcaster)
- func (s *ChallengeStore) SyncFromCluster(token, keyAuth string, deleted bool)
- type ClusterBroadcaster
- type Local
- func (ci *Local) CAExists() bool
- func (ci *Local) CAExistsInSystem() bool
- func (ci *Local) EnsureForHost(host string, port int) (certFile, keyFile string, err error)
- func (ci *Local) EnsureLocalhostCert() (string, string, error)
- func (ci *Local) HasCertutil() bool
- func (ci *Local) InstallCARootIfNeeded() error
- func (ci *Local) ListCertificates() ([]string, error)
- func (ci *Local) RemoveCA()
- func (ci *Local) SetHosts(hosts []string, port int)
- func (ci *Local) SetMockMode(mock bool)
- func (ci *Local) UninstallCARoot() error
- type Manager
- func (m *Manager) ApplyClusterCertificate(domain string, certPEM, keyPEM []byte) error
- func (m *Manager) ApplyClusterChallenge(token, keyAuth string, deleted bool)
- func (m *Manager) Close()
- func (m *Manager) DeleteCertificate(domain string) error
- func (m *Manager) EnsureCertMagic(next http.Handler) (http.Handler, error)
- func (m *Manager) GetCertificate(chi *tls.ClientHelloInfo) (*tls.Certificate, error)
- func (m *Manager) GetConfigForClient(chi *tls.ClientHelloInfo) (*tls.Config, error)
- func (m *Manager) LikelyInternal(name string) bool
- func (m *Manager) ListCertificates() ([]string, error)
- func (m *Manager) LoadCertificate(domain string) (certPEM, keyPEM []byte, err error)
- func (m *Manager) PreloadLocalCertificates(hosts map[string]*alaye.Host)
- func (m *Manager) SetCluster(c ClusterBroadcaster)
- func (m *Manager) SetUpdateCallback(fn func(domain string, certPEM, keyPEM []byte))
- func (m *Manager) UpdateCertificate(domain string, certPEM, keyPEM []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BootstrapEnv ¶
func IsCARootInstalled ¶
Types ¶
type ACMEProvider ¶
type ACMEProvider struct {
// contains filtered or unexported fields
}
func NewACMEProvider ¶
func NewACMEProvider(logger *ll.Logger, storage tlsstore.Store, challenges *ChallengeStore, global alaye.LetsEncrypt) *ACMEProvider
func (*ACMEProvider) ObtainCert ¶
func (p *ACMEProvider) ObtainCert(domain string, setting alaye.LetsEncrypt) (*tls.Certificate, []byte, []byte, error)
type AcmeUser ¶
type AcmeUser struct {
Email string
Registration *registration.Resource
// contains filtered or unexported fields
}
func (*AcmeUser) GetPrivateKey ¶
func (u *AcmeUser) GetPrivateKey() crypto.PrivateKey
func (*AcmeUser) GetRegistration ¶
func (u *AcmeUser) GetRegistration() *registration.Resource
type ChallengeStore ¶
type ChallengeStore struct {
// contains filtered or unexported fields
}
func NewChallengeStore ¶
func NewChallengeStore(logger *ll.Logger) *ChallengeStore
NewChallengeStore initializes an in-memory repository for ACME tokens. It bridges standard HTTP-01 challenges to the gossip mesh.
func (*ChallengeStore) CleanUp ¶
func (s *ChallengeStore) CleanUp(domain, token, keyAuth string) error
CleanUp deletes a fulfilled challenge and broadcasts the teardown.
func (*ChallengeStore) GetKeyAuth ¶
func (s *ChallengeStore) GetKeyAuth(token string) (string, bool)
GetKeyAuth serves HTTP-01 validation requests directly from memory.
func (*ChallengeStore) Present ¶
func (s *ChallengeStore) Present(domain, token, keyAuth string) error
Present surfaces an ACME challenge token locally and relays it to peers. Allows any node in the cluster to respond successfully to Let's Encrypt.
func (*ChallengeStore) SetCluster ¶
func (s *ChallengeStore) SetCluster(c ClusterBroadcaster)
SetCluster binds the distributed broadcaster to the local store.
func (*ChallengeStore) SyncFromCluster ¶
func (s *ChallengeStore) SyncFromCluster(token, keyAuth string, deleted bool)
SyncFromCluster registers ACME tokens generated by other nodes.
type ClusterBroadcaster ¶
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
func (*Local) CAExistsInSystem ¶
CAExistsInSystem is the public API for checking CA trust store presence.
func (*Local) EnsureForHost ¶
EnsureForHost ensures a certificate exists for a specific host and port.
func (*Local) EnsureLocalhostCert ¶
EnsureLocalhostCert ensures a local development certificate exists for the configured hosts. Returns the domain identifier (for storage lookup) on success.
func (*Local) HasCertutil ¶
HasCertutil reports whether certutil is available on the system.
func (*Local) InstallCARootIfNeeded ¶
InstallCARootIfNeeded generates a CA root if missing and installs it to system trust stores.
func (*Local) ListCertificates ¶
func (*Local) RemoveCA ¶
func (ci *Local) RemoveCA()
RemoveCA deletes the CA certificate from storage.
func (*Local) SetMockMode ¶
SetMockMode enables or disables mock mode (skips system trust store operations).
func (*Local) UninstallCARoot ¶
type Manager ¶
type Manager struct {
Challenges *ChallengeStore
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) ApplyClusterCertificate ¶
func (*Manager) ApplyClusterChallenge ¶
func (*Manager) DeleteCertificate ¶
func (*Manager) EnsureCertMagic ¶
func (*Manager) GetCertificate ¶
func (m *Manager) GetCertificate(chi *tls.ClientHelloInfo) (*tls.Certificate, error)
func (*Manager) GetConfigForClient ¶
func (*Manager) LikelyInternal ¶
func (*Manager) ListCertificates ¶
func (*Manager) LoadCertificate ¶
func (*Manager) PreloadLocalCertificates ¶
PreloadLocalCertificates generates and caches TLS certificates for all hosts that use ModeLocalAuto before any listeners start.
Calling this during server startup eliminates the first-request race condition where concurrent browser connections all find an empty cache, trigger parallel on-demand generation, and some receive nil mid-write. getCertificateLocal continues to use localFlight as a safety net for domains that are added dynamically after startup or that are not present at boot.
Hosts whose certificate is already in the cache (loaded by loadFromStorage) are skipped — no duplicate work is done.
func (*Manager) SetCluster ¶
func (m *Manager) SetCluster(c ClusterBroadcaster)