validate checks if the given challenge is supported.
()
| 19 | |
| 20 | // validate checks if the given challenge is supported. |
| 21 | func (c ACMEChallenge) validate() error { |
| 22 | switch c { |
| 23 | case HTTP_01, DNS_01, TLS_ALPN_01: |
| 24 | return nil |
| 25 | default: |
| 26 | return fmt.Errorf("acme challenge %q is not supported", c) |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | // The unmarshaller first marshals the value into a string. Then it |
| 31 | // trims any space around it and lowercase it for normaliztion. The |