Documentation
¶
Overview ¶
Package http implements a http-01 ACME protocol responder.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateRedirectServer ¶
func CreateRedirectServer(portNum uint16, logger log.DebugLogger) error
CreateRedirectServer is a convenience function that creates a redirecting HTTP server on port portNum. Do not use this if NewListener is also used.
Types ¶
type RedirectHandler ¶
type RedirectHandler struct{}
func (*RedirectHandler) ServeHTTP ¶
func (h *RedirectHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP serves HTTP requests. All GET and HEAD requests will be redirected to the default TLS port 443 with 302 Found status code, preserving the original request path and query. It responds with 400 Bad Request to all other HTTP methods.
type Responder ¶
type Responder struct {
// contains filtered or unexported fields
}
func NewHandler ¶
NewHandler creates a HTTP handler. The handler will respond to ACME "http-01" challenges. A *RedirectHandler may be passed in through fallback. If this is nil, all non-ACME challenge responses will be rejected. The logger is used for logging messages.
func NewServer ¶
NewServer creates a HTTP server on port number portNum. This should normally be 80, unless your firewall is configured to DNAT from port 80 on a public IP to portNum. The server will respond to ACME "http-01" challenges. A *RedirectHandler may be passed in through fallback. If this is nil, a call to the Cleanup method will cause new connections to be accepted and immediately closed until the next Respond method is called, minimising the attack surface. The logger is used for logging messages.