CAServer is a simple test server which implements ACME spec bits needed for testing.
type CAServer struct {
// contains filtered or unexported fields
}
func NewCAServer(t *testing.T) *CAServer
NewCAServer creates a new ACME test server. The returned CAServer issues certs signed with the CA roots available in the Roots field.
func (ca *CAServer) ChallengeTypes(types ...string) *CAServer
ChallengeTypes sets the supported challenge types.
func (ca *CAServer) ExternalAccountRequired() *CAServer
ExternalAccountRequired makes an EAB JWS required for account registration.
func (ca *CAServer) IssuerName(name pkix.Name) *CAServer
IssuerName sets the name of the issuing CA.
func (ca *CAServer) LeafCert(name, keyType string, notBefore, notAfter time.Time) *tls.Certificate
LeafCert issues a leaf certificate.
func (ca *CAServer) Resolve(domain, addr string)
Resolve adds a domain to address resolution for the ca to dial to when validating challenges for the domain authorization.
func (ca *CAServer) ResolveGetCertificate(domain string, f getCertificateFunc)
ResolveGetCertificate redirects TLS connections for domain to f when validating challenges for the domain authorization.
func (ca *CAServer) ResolveHandler(domain string, h http.Handler)
ResolveHandler redirects HTTP requests for domain to f when validating challenges for the domain authorization.
func (ca *CAServer) Roots() *x509.CertPool
Roots returns a pool cointaining the CA root.
func (ca *CAServer) Start() *CAServer
Start starts serving requests. The server address becomes available in the URL field.
func (ca *CAServer) URL() string
URL returns the server address, after Start has been called.