dns01

package
v4.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPropagationTimeout default propagation timeout.
	DefaultPropagationTimeout = 60 * time.Second

	// DefaultPollingInterval default polling interval.
	DefaultPollingInterval = 2 * time.Second

	// DefaultTTL default TTL.
	DefaultTTL = 120
)

Variables

This section is empty.

Functions

func ClearFqdnCache

func ClearFqdnCache()

ClearFqdnCache clears the cache of fqdn to zone mappings. Primarily used in testing.

func ExtractSubDomain

func ExtractSubDomain(domain, zone string) (string, error)

ExtractSubDomain extracts the subdomain part from a domain and a zone.

func FindPrimaryNsByFqdn

func FindPrimaryNsByFqdn(fqdn string) (string, error)

FindPrimaryNsByFqdn determines the primary nameserver of the zone apex for the given fqdn by recursing up the domain labels until the nameserver returns a SOA record in the answer section.

func FindPrimaryNsByFqdnCustom

func FindPrimaryNsByFqdnCustom(fqdn string, nameservers []string) (string, error)

FindPrimaryNsByFqdnCustom determines the primary nameserver of the zone apex for the given fqdn by recursing up the domain labels until the nameserver returns a SOA record in the answer section.

func FindZoneByFqdn

func FindZoneByFqdn(fqdn string) (string, error)

FindZoneByFqdn determines the zone apex for the given fqdn by recursing up the domain labels until the nameserver returns a SOA record in the answer section.

func FindZoneByFqdnCustom

func FindZoneByFqdnCustom(fqdn string, nameservers []string) (string, error)

FindZoneByFqdnCustom determines the zone apex for the given fqdn by recursing up the domain labels until the nameserver returns a SOA record in the answer section.

func GetRecord

func GetRecord(domain, keyAuth string) (fqdn, value string)

GetRecord returns a DNS record which will fulfill the `dns-01` challenge. Deprecated: use GetChallengeInfo instead.

func ParseNameservers

func ParseNameservers(servers []string) []string

func ToFqdn

func ToFqdn(name string) string

ToFqdn converts the name into a fqdn appending a trailing dot.

func UnFqdn

func UnFqdn(name string) string

UnFqdn converts the fqdn into a name removing the trailing dot.

Types

type Challenge

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

Challenge implements the dns-01 challenge.

func NewChallenge

func NewChallenge(core *api.Core, validate ValidateFunc, provider challenge.Provider, opts ...ChallengeOption) *Challenge

func (*Challenge) CleanUp

func (c *Challenge) CleanUp(authz acme.Authorization) error

CleanUp cleans the challenge.

func (*Challenge) PreSolve

func (c *Challenge) PreSolve(authz acme.Authorization) error

PreSolve just submits the txt record to the dns provider. It does not validate record propagation, or do anything at all with the acme server.

func (*Challenge) Sequential

func (c *Challenge) Sequential() (bool, time.Duration)

func (*Challenge) Solve

func (c *Challenge) Solve(authz acme.Authorization) error

type ChallengeInfo

type ChallengeInfo struct {
	// FQDN is the full-qualified challenge domain (i.e. `_acme-challenge.[domain].`)
	FQDN string

	// EffectiveFQDN contains the resulting FQDN after the CNAMEs resolutions.
	EffectiveFQDN string

	// Value contains the value for the TXT record.
	Value string
}

ChallengeInfo contains the information use to create the TXT record.

func GetChallengeInfo

func GetChallengeInfo(domain, keyAuth string) ChallengeInfo

GetChallengeInfo returns information used to create a DNS record which will fulfill the `dns-01` challenge.

type ChallengeOption

type ChallengeOption func(*Challenge) error

func AddDNSTimeout

func AddDNSTimeout(timeout time.Duration) ChallengeOption

func AddRecursiveNameservers

func AddRecursiveNameservers(nameservers []string) ChallengeOption

func CondOption

func CondOption(condition bool, opt ChallengeOption) ChallengeOption

CondOption Conditional challenge option.

func DisableCompletePropagationRequirement

func DisableCompletePropagationRequirement() ChallengeOption

func WrapPreCheck

func WrapPreCheck(wrap WrapPreCheckFunc) ChallengeOption

WrapPreCheck Allow to define checks before notifying ACME that the DNS challenge is ready.

type DNSProviderManual

type DNSProviderManual struct{}

DNSProviderManual is an implementation of the ChallengeProvider interface.

func NewDNSProviderManual

func NewDNSProviderManual() (*DNSProviderManual, error)

NewDNSProviderManual returns a DNSProviderManual instance.

func (*DNSProviderManual) CleanUp

func (*DNSProviderManual) CleanUp(domain, token, keyAuth string) error

CleanUp prints instructions for manually removing the TXT record.

func (*DNSProviderManual) Present

func (*DNSProviderManual) Present(domain, token, keyAuth string) error

Present prints instructions for manually creating the TXT record.

func (*DNSProviderManual) Sequential

func (d *DNSProviderManual) Sequential() time.Duration

Sequential All DNS challenges for this provider will be resolved sequentially. Returns the interval between each iteration.

type PreCheckFunc

type PreCheckFunc func(fqdn, value string) (bool, error)

PreCheckFunc checks DNS propagation before notifying ACME that the DNS challenge is ready.

type ValidateFunc

type ValidateFunc func(core *api.Core, domain string, chlng acme.Challenge) error

type WrapPreCheckFunc

type WrapPreCheckFunc func(domain, fqdn, value string, check PreCheckFunc) (bool, error)

WrapPreCheckFunc wraps a PreCheckFunc in order to do extra operations before or after the main check, put it in a loop, etc.

Jump to

Keyboard shortcuts

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