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

Function challengeKey

solvers.go:856–864  ·  view source on GitHub ↗

challengeKey returns the map key for a given challenge; it is the identifier unless it is an IP address using the TLS-ALPN challenge.

(chal acme.Challenge)

Source from the content-addressed store, hash-verified

854// challengeKey returns the map key for a given challenge; it is the identifier
855// unless it is an IP address using the TLS-ALPN challenge.
856func challengeKey(chal acme.Challenge) string {
857 if chal.Type == acme.ChallengeTypeTLSALPN01 && chal.Identifier.Type == "ip" {
858 reversed, err := dns.ReverseAddr(chal.Identifier.Value)
859 if err == nil {
860 return reversed[:len(reversed)-1] // strip off '.'
861 }
862 }
863 return chal.Identifier.Value
864}
865
866// solverWrapper should be used to wrap all challenge solvers so that
867// we can add the challenge info to memory; this makes challenges globally

Callers 6

PresentMethod · 0.85
PresentMethod · 0.85
CleanUpMethod · 0.85
PresentMethod · 0.85
CleanUpMethod · 0.85
Test_challengeKeyFunction · 0.85

Calls

no outgoing calls

Tested by 1

Test_challengeKeyFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…