acmetest

package
v2.0.3+incompatible Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: GPL-3.0, BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

Package acmetest provides types for testing acme and autocert packages.

TODO: Consider moving this to x/crypto/acme/internal/acmetest for acme tests as well.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CAServer

type CAServer struct {
	URL   string         // server URL after it has been started
	Roots *x509.CertPool // CA root certificates; initialized in NewCAServer
	// contains filtered or unexported fields
}

CAServer is a simple test server which implements ACME spec bits needed for testing.

func NewCAServer

func NewCAServer(challengeTypes []string, domainsWhitelist []string) *CAServer

NewCAServer creates a new ACME test server and starts serving requests. The returned CAServer issues certs signed with the CA roots available in the Roots field.

The challengeTypes argument defines the supported ACME challenge types sent to a client in a response for a domain authorization. If domainsWhitelist is non-empty, the certs will be issued only for the specified list of domains. Otherwise, any domain name is allowed.

func (*CAServer) Close

func (ca *CAServer) Close()

Close shuts down the server and blocks until all outstanding requests on this server have completed.

func (*CAServer) Errors

func (ca *CAServer) Errors() []error

Errors returns all client errors.

func (*CAServer) Resolve

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.

Jump to

Keyboard shortcuts

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