package acmetest
import "golang.org/x/crypto/acme/autocert/internal/acmetest"
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 ¶
- type CAServer
- func NewCAServer(t *testing.T) *CAServer
- func (ca *CAServer) ChallengeTypes(types ...string) *CAServer
- func (ca *CAServer) ExternalAccountRequired() *CAServer
- func (ca *CAServer) IssuerName(name pkix.Name) *CAServer
- func (ca *CAServer) LeafCert(name, keyType string, notBefore, notAfter time.Time) *tls.Certificate
- func (ca *CAServer) Resolve(domain, addr string)
- func (ca *CAServer) ResolveGetCertificate(domain string, f getCertificateFunc)
- func (ca *CAServer) ResolveHandler(domain string, h http.Handler)
- func (ca *CAServer) Roots() *x509.CertPool
- func (ca *CAServer) Start() *CAServer
- func (ca *CAServer) URL() string
Types ¶
type CAServer ¶
type CAServer struct {
// contains filtered or unexported fields
}
CAServer is a simple test server which implements ACME spec bits needed for testing.
func NewCAServer ¶
NewCAServer creates a new ACME test server. The returned CAServer issues certs signed with the CA roots available in the Roots field.
func (*CAServer) ChallengeTypes ¶
ChallengeTypes sets the supported challenge types.
func (*CAServer) ExternalAccountRequired ¶
ExternalAccountRequired makes an EAB JWS required for account registration.
func (*CAServer) IssuerName ¶
IssuerName sets the name of the issuing CA.
func (*CAServer) LeafCert ¶
LeafCert issues a leaf certificate.
func (*CAServer) Resolve ¶
Resolve adds a domain to address resolution for the ca to dial to when validating challenges for the domain authorization.
func (*CAServer) ResolveGetCertificate ¶
ResolveGetCertificate redirects TLS connections for domain to f when validating challenges for the domain authorization.
func (*CAServer) ResolveHandler ¶
ResolveHandler redirects HTTP requests for domain to f when validating challenges for the domain authorization.
func (*CAServer) Roots ¶
Roots returns a pool cointaining the CA root.
func (*CAServer) Start ¶
Start starts serving requests. The server address becomes available in the URL field.
func (*CAServer) URL ¶
URL returns the server address, after Start has been called.
Source Files ¶
ca.go
- Version
- v0.34.0 (latest)
- Published
- Feb 22, 2025
- Platform
- linux/amd64
- Imports
- 26 packages
- Last checked
- 1 hour ago –
Tools for package owners.