mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
6f78cc49d1
- Using xenolf/lego's likely-temporary acmev2 branch - Cleaned up vendor folder a little bit (probably more to do) - Temporarily set default CA URL to v2 staging endpoint - Refactored user management a bit; updated tests (biggest change is how we get the email address, which now requires being able to make an ACME client with a User with a private key so that we can get the current ToS URL) - Automatic HTTPS now allows specific wildcard pattern hostnames - Commented out (but kept) the TLS-SNI code, as the challenge type may return in the future in a similar form
28 lines
1.1 KiB
Go
28 lines
1.1 KiB
Go
package acme
|
|
|
|
import "time"
|
|
|
|
// ChallengeProvider enables implementing a custom challenge
|
|
// provider. Present presents the solution to a challenge available to
|
|
// be solved. CleanUp will be called by the challenge if Present ends
|
|
// in a non-error state.
|
|
type ChallengeProvider interface {
|
|
Present(domain, token, keyAuth string) error
|
|
CleanUp(domain, token, keyAuth string) error
|
|
}
|
|
|
|
// ChallengeProviderTimeout allows for implementing a
|
|
// ChallengeProvider where an unusually long timeout is required when
|
|
// waiting for an ACME challenge to be satisfied, such as when
|
|
// checking for DNS record progagation. If an implementor of a
|
|
// ChallengeProvider provides a Timeout method, then the return values
|
|
// of the Timeout method will be used when appropriate by the acme
|
|
// package. The interval value is the time between checks.
|
|
//
|
|
// The default values used for timeout and interval are 60 seconds and
|
|
// 2 seconds respectively. These are used when no Timeout method is
|
|
// defined for the ChallengeProvider.
|
|
type ChallengeProviderTimeout interface {
|
|
ChallengeProvider
|
|
Timeout() (timeout, interval time.Duration)
|
|
}
|