http01

package
v3.0.0-...-ff2cd32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChallengePath

func ChallengePath(token string) string

ChallengePath returns the URL path for the `http-01` challenge

Types

type Challenge

type Challenge struct {
	// contains filtered or unexported fields
}

func NewChallenge

func NewChallenge(core *api.Core, validate ValidateFunc, provider challenge.Provider) *Challenge

func (*Challenge) SetProvider

func (c *Challenge) SetProvider(provider challenge.Provider)

func (*Challenge) Solve

func (c *Challenge) Solve(authz acme.Authorization) error

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 (*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 standadized 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://tools.ietf.org/html/rfc7239 - any other value will check the header value with the same name

type ValidateFunc

type ValidateFunc func(core *api.Core, domain string, chlng acme.Challenge) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL