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

Method Present

solvers.go:634–650  ·  view source on GitHub ↗

Present invokes the underlying solver's Present method and also stores domain, token, and keyAuth to the storage backing the certificate cache of dhs.acmeIssuer.

(ctx context.Context, chal acme.Challenge)

Source from the content-addressed store, hash-verified

632// and also stores domain, token, and keyAuth to the storage
633// backing the certificate cache of dhs.acmeIssuer.
634func (dhs distributedSolver) Present(ctx context.Context, chal acme.Challenge) error {
635 infoBytes, err := json.Marshal(chal)
636 if err != nil {
637 return err
638 }
639
640 err = dhs.storage.Store(ctx, dhs.challengeTokensKey(challengeKey(chal)), infoBytes)
641 if err != nil {
642 return err
643 }
644
645 err = dhs.solver.Present(ctx, chal)
646 if err != nil {
647 return fmt.Errorf("presenting with embedded solver: %v", err)
648 }
649 return nil
650}
651
652// Wait wraps the underlying solver's Wait() method, if any. Implements acmez.Waiter.
653func (dhs distributedSolver) Wait(ctx context.Context, challenge acme.Challenge) error {

Callers

nothing calls this directly

Calls 4

challengeTokensKeyMethod · 0.95
challengeKeyFunction · 0.85
StoreMethod · 0.65
PresentMethod · 0.45

Tested by

no test coverage detected