cert

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MPL-2.0 Imports: 30 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
}

Manager handles TLS certificate lifecycle.

Supported modes (CertConfig.CertMode):

  • "http" — ACME HTTP-01 challenge via certmagic (needs port 80).
  • "dns" — ACME DNS-01 challenge via certmagic + libdns provider.
  • "self" — Self-signed certificate generated in memory.
  • "file" — User-provided certificate and key file paths (CertFile/KeyFile).
  • "content" — Certificate and key PEM content pushed from the panel.
  • "none" — No TLS. The node will handle plain connections.

All modes normalise to in-memory PEM. Kernels never see file paths — they always receive PEM bytes via TLSCert().

Priority Logic (when CertMode is empty):

  1. "http" (if auto_tls is true)
  2. "content" (if both CertContent and KeyContent are provided)
  3. "file" (if both CertFile and KeyFile paths are provided)
  4. "none" (default)

func NewManager

func NewManager(cfg config.CertConfig) *Manager

NewManager creates a certificate manager.

func (*Manager) CertRenewed

func (m *Manager) CertRenewed() bool

func (*Manager) HasCert

func (m *Manager) HasCert() bool

func (*Manager) Reconfigure

func (m *Manager) Reconfigure(ctx context.Context, newCfg config.CertConfig) (bool, error)

Reconfigure applies a new cert configuration at runtime (e.g. from panel push). Returns true when the PEM material changed (caller should restart kernel).

func (*Manager) Start

func (m *Manager) Start(ctx context.Context) error

Start initializes the cert manager based on the resolved mode.

func (*Manager) Stop

func (m *Manager) Stop()

Stop is a no-op: certmagic's background goroutine is cancelled via the context passed to ManageAsync.

func (*Manager) TLSCert

func (m *Manager) TLSCert() kernel.TLSCert

TLSCert returns the current PEM material as a kernel.TLSCert.

type Pool

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

func NewPool

func NewPool(dir string) *Pool

func (*Pool) Commit

func (p *Pool) Commit(c protocol.Config)

func (*Pool) Prepare

func (p *Pool) Prepare(ctx context.Context, c protocol.Config) (protocol.Config, error)

func (*Pool) Renewed

func (p *Pool) Renewed() bool

func (*Pool) Status

func (p *Pool) Status() map[string]ProfileStatus

func (*Pool) Stop

func (p *Pool) Stop()

type ProfileStatus

type ProfileStatus struct {
	Domain       string    `json:"domain"`
	Expires      time.Time `json:"expires"`
	Expiring     bool      `json:"expiring"`
	ObtainMillis int64     `json:"obtain_millis"`
}

Directories

Path Synopsis
Package dnsproviders is a registry of DNS providers usable for ACME DNS-01 challenges.
Package dnsproviders is a registry of DNS providers usable for ACME DNS-01 challenges.

Jump to

Keyboard shortcuts

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