(t *testing.T)
| 220 | } |
| 221 | |
| 222 | func TestGetACMEChallenge_IPv6Brackets(t *testing.T) { |
| 223 | // Store a challenge under a bare IPv6 identifier (as CertMagic does internally). |
| 224 | bare := "::1" |
| 225 | activeChallengesMu.Lock() |
| 226 | activeChallenges[bare] = Challenge{} |
| 227 | activeChallengesMu.Unlock() |
| 228 | defer func() { |
| 229 | activeChallengesMu.Lock() |
| 230 | delete(activeChallenges, bare) |
| 231 | activeChallengesMu.Unlock() |
| 232 | }() |
| 233 | |
| 234 | // Lookup with bracketed IPv6 (as received from Go's HTTP server via r.Host). |
| 235 | if _, ok := GetACMEChallenge("[::1]"); !ok { |
| 236 | t.Error("GetACMEChallenge(\"[::1]\") should find challenge stored under \"::1\"") |
| 237 | } |
| 238 | // Lookup with bare IPv6 should still work. |
| 239 | if _, ok := GetACMEChallenge("::1"); !ok { |
| 240 | t.Error("GetACMEChallenge(\"::1\") should find challenge stored under \"::1\"") |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | func TestTryListen(t *testing.T) { |
| 245 | // Make sure that a regular TCP address still works. |
nothing calls this directly
no test coverage detected
searching dependent graphs…