Documentation ¶
Overview ¶
Package autocertdelegate provides a mechanism to provision LetsEncrypt certs for internal LAN TLS servers (that aren't reachable publicly) via a delegated server that is.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client fetches certs from the Server. Its GetCertificate method is suitable for use by an HTTP server's TLSConfig.GetCertificate.
func NewClient ¶
NewClient returns a new client fetching from the provided server hostname. The server must be a hostname only (without a scheme or path).
func (*Client) GetCertificate ¶
func (c *Client) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate fetches a certificate suitable for responding to the provided hello. The signature of GetCertificate is suitable for use by an HTTP server's TLSConfig.GetCertificate.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is an http.Handler that runs on the Internet-facing daemon and gets the TLS certs from LetsEncrypt (using ALPN challenges) and gives them out to internal clients.
It will only give them out to internal clients whose DNS names resolve to internal IP addresses and who can provide that they are running code on that IP address. (This assumes that such hostnames aren't multi-user systems with untrusted users.)
func (*Server) ServeHTTP ¶
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP is the HTTP handler to get challenges & certs for the Client. The Handler only responds to GET requests over TLS. It can be installed at any path, but the client only makes requests to the root. It's assumed that any existing HTTP mux is routing based on the hostname.