MCPcopy
hub / github.com/caddyserver/certmagic / Present

Method Present

solvers.go:261–280  ·  view source on GitHub ↗

Present creates the DNS TXT record for the given ACME challenge.

(ctx context.Context, challenge acme.Challenge)

Source from the content-addressed store, hash-verified

259
260// Present creates the DNS TXT record for the given ACME challenge.
261func (s *DNS01Solver) Present(ctx context.Context, challenge acme.Challenge) error {
262 dnsName := challenge.DNS01TXTRecordName()
263 if s.OverrideDomain != "" {
264 dnsName = s.OverrideDomain
265 }
266 keyAuth := challenge.DNS01KeyAuthorization()
267
268 zrec, err := s.DNSManager.createRecord(ctx, dnsName, "TXT", keyAuth)
269 if err != nil {
270 return err
271 }
272
273 // remember the record and zone we got so we can clean up more efficiently
274 s.saveDNSPresentMemory(dnsPresentMemory{
275 dnsName: dnsName,
276 zoneRec: zrec,
277 })
278
279 return nil
280}
281
282// Wait blocks until the TXT record created in Present() appears in
283// authoritative lookups, i.e. until it has propagated, or until

Callers

nothing calls this directly

Calls 2

createRecordMethod · 0.80
saveDNSPresentMemoryMethod · 0.80

Tested by

no test coverage detected