Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChallengePath ¶
ChallengePath returns the URL path for the `http-01` challenge.
Types ¶
type Challenge ¶
type Challenge struct {
// contains filtered or unexported fields
}
func NewChallenge ¶
func (*Challenge) SetProvider ¶
type ProviderServer ¶
type ProviderServer struct {
// contains filtered or unexported fields
}
ProviderServer implements ChallengeProvider for `http-01` challenge. It may be instantiated without using the NewProviderServer function if you want only to use the default values.
func NewProviderServer ¶
func NewProviderServer(iface, port string) *ProviderServer
NewProviderServer creates a new ProviderServer on the selected interface and port. Setting iface and / or port to an empty string will make the server fall back to the "any" interface and port 80 respectively.
func NewUnixProviderServer ¶
func NewUnixProviderServer(socketPath string, mode fs.FileMode) *ProviderServer
func (*ProviderServer) CleanUp ¶
func (s *ProviderServer) CleanUp(domain, token, keyAuth string) error
CleanUp closes the HTTP server and removes the token from `ChallengePath(token)`.
func (*ProviderServer) GetAddress ¶
func (s *ProviderServer) GetAddress() string
func (*ProviderServer) Present ¶
func (s *ProviderServer) Present(domain, token, keyAuth string) error
Present starts a web server and makes the token available at `ChallengePath(token)` for web requests.
func (*ProviderServer) SetProxyHeader ¶
func (s *ProviderServer) SetProxyHeader(headerName string)
SetProxyHeader changes the validation of incoming requests. By default, s matches the "Host" header value to the domain name.
When the server runs behind a proxy server, this is not the correct place to look at; Apache and NGINX have traditionally moved the original Host header into a new header named "X-Forwarded-Host". Other webservers might use different names; and RFC7239 has standardized a new header named "Forwarded" (with slightly different semantics).
The exact behavior depends on the value of headerName: - "" (the empty string) and "Host" will restore the default and only check the Host header - "Forwarded" will look for a Forwarded header, and inspect it according to https://www.rfc-editor.org/rfc/rfc7239.html - any other value will check the header value with the same name.