Documentation ¶
Index ¶
Constants ¶
const ( // PebbleConfigJSON contains the configration of Pebble. PebbleConfigJSON = "testdata/pebble-config.json" // DNSPort is the port pebble uses for DNS queries. DNSPort = "8053" )
Variables ¶
This section is empty.
Functions ¶
func InitializeLego ¶
InitializeLego initializes the lego library.
Lego uses a global variable to store a logger. In order to use a different loger this variable has to be set. The InitializeLego function uses a sync.Once ensures that the Logger is set only once, no matter how often the function is called. However, direct access to leoglog.Logger cannot be protected.
func NewChallengeServer ¶
NewChallengeServer creates an httptest.Server which uses the handler to serve HTTP01 challenges.
Types ¶
type Client ¶
type Client struct { DirectoryURL string HTTP01Solver HTTP01Solver }
Client is an ACME protocol client capable of obtaining and renewing certificates.
func (*Client) CreateAccount ¶
CreateAccount creates a new ACME account for the accountKey.
If email is not empty it is used as the contact address for the new account.
func (*Client) ObtainCertificate ¶
func (c *Client) ObtainCertificate(req acme.CertificateRequest) (*acme.CertificateInfo, error)
ObtainCertificate obtains a new certificate from the remote ACME server.
type HTTP01Solver ¶
HTTP01Solver is a custom challenge provider for the HTTP01 challenge.
In contrast to the default HTTP01 challenge provider shipped with lego it does not start a web-server but instead provides a handle challenge method which can be used in an http.Handler or http.HandlerFunc.
HTTP01Solver is safe for concurrent access by multiple Go routines.
The methods Present and CleanUp are intended for use by lego and should not be called directly.
The zero value of HTTP01Solver is fully functional.
func (*HTTP01Solver) CleanUp ¶
func (p *HTTP01Solver) CleanUp(domain, token, keyAuth string) error
CleanUp removes the solution for a HTTP01 challenge from the HTTP01Solver.
This method is intended to be used by lego and should not be called directly.
func (*HTTP01Solver) Handler ¶
Handler creates an http.Handler serving the actual HTTP01 challenge.
The extractParams function is used to extract the required parameters from the request. It must return a map containing the keys domain and token, or nil if the map cannot be constructed.
func (*HTTP01Solver) Present ¶
func (p *HTTP01Solver) Present(domain, token, keyAuth string) error
Present registers a solution for a HTTP01 challenge with the HTTP01Solver.
This method is intended to be used by lego and should not be called directly.
type TestFixture ¶
type TestFixture struct { Pebble *testsupport.Pebble Client *Client }
TestFixture wraps a Client suitable for testing.
func NewTestFixture ¶
func NewTestFixture(t *testing.T) (TestFixture, func())
NewTestFixture creates a new test fixture.
type User ¶
type User struct { Email string Registration *registration.Resource PrivateKey crypto.PrivateKey }
User represents an user of the ACME certificate authority.
It implements https://godoc.org/github.com/go-acme/lego/registration#User.
func (*User) GetPrivateKey ¶
func (u *User) GetPrivateKey() crypto.PrivateKey
GetPrivateKey returns the users private key.
func (*User) GetRegistration ¶
func (u *User) GetRegistration() *registration.Resource
GetRegistration returns the users registration.