acme

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 14 Imported by: 3

Documentation

Overview

Taken from https://github.com/chinzhiweiblank/coredns-acme/blob/e0cdfbdd78adfcc6c2d098255902f64ec60daecb/provider.go Copyright @chinzhiweiblank under Apache License 2.0

Index

Constants

View Source
const (
	DNSChallengeString   = "_acme-challenge."
	CertificateAuthority = "letsencrypt.org."
)

Variables

View Source
var DefaultResolvers = []string{
	"1.1.1.1:53",
	"1.0.0.1:53",
	"8.8.8.8:53",
	"8.8.4.4:53",
}

DefaultResolvers trusted

Functions

func CleanupStorage added in v1.0.5

func CleanupStorage()

CleanupStorage perform cleanup routines tasks

func ExtractCaddyPaths added in v1.2.0

func ExtractCaddyPaths(cfg *certmagic.Config, issuer certmagic.Issuer, domain string) (certPath, privKeyPath string, err error)

ExtractCaddyPaths attempts to extract cert and private key through the layers of abstractions from the domain name

func NewCertmagicConfig added in v1.4.0

func NewCertmagicConfig(email string, store *Provider, debug bool, customResolvers []string) (*certmagic.Config, error)

NewCertmagicConfig creates and configures a *certmagic.Config for ACME DNS-01 challenge. The returned config can be reused across multiple HandleWildcardCertificates calls.

Types

type CertReloader added in v1.4.0

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

CertReloader watches a certificate/key file pair and reloads when files change on disk.

func NewCertReloader added in v1.4.0

func NewCertReloader(certPath, keyPath string) (*CertReloader, error)

NewCertReloader loads the initial certificate and returns a reloader.

func (*CertReloader) GetCertificate added in v1.4.0

func (r *CertReloader) GetCertificate(_ *tls.ClientHelloInfo) (*tls.Certificate, error)

GetCertificate returns the current certificate. Safe for concurrent use.

func (*CertReloader) Start added in v1.4.0

func (r *CertReloader) Start(ctx context.Context)

Start polls for certificate file changes and reloads when detected. Blocks until ctx is cancelled. The check interval is configurable via the CERT_CHECK_INTERVAL env variable (e.g. "30m", "2h").

type CertificateFiles added in v1.2.0

type CertificateFiles struct {
	CertPath    string
	PrivKeyPath string
}

func HandleWildcardCertificates added in v1.0.0

func HandleWildcardCertificates(cfg *certmagic.Config, domain string) ([]tls.Certificate, []CertificateFiles, error)

HandleWildcardCertificates handles ACME wildcard cert generation with DNS challenge using certmagic library from caddyserver.

type Provider added in v1.0.0

type Provider struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewProvider added in v1.0.0

func NewProvider() *Provider

func (*Provider) AppendRecords added in v1.0.0

func (p *Provider) AppendRecords(ctx context.Context, zoneName string, recs []libdns.Record) ([]libdns.Record, error)

func (*Provider) DeleteRecords added in v1.0.0

func (p *Provider) DeleteRecords(ctx context.Context, zoneName string, recs []libdns.Record) ([]libdns.Record, error)

func (*Provider) GetRecords added in v1.0.0

func (p *Provider) GetRecords(ctx context.Context, zoneName string) ([]libdns.Record, error)

type RecordStore added in v1.0.0

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

Jump to

Keyboard shortcuts

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