Documentation
¶
Index ¶
- type Client
- func (c *Client) AddAAAARecord(host string, addresses []string) ([]byte, error)
- func (c *Client) AddARecord(host string, addresses []string) ([]byte, error)
- func (c *Client) AddCAAIssue(host, value string) ([]byte, error)
- func (c *Client) AddDNS01Response(host, value string) ([]byte, error)
- func (c *Client) AddDNSAccount01Response(accountURL, host, value string) ([]byte, error)
- func (c *Client) AddHTTP01Response(token, keyauth string) ([]byte, error)
- func (c *Client) AddHTTPRedirect(path, targetURL string) ([]byte, error)
- func (c *Client) AddServfailResponse(host string) ([]byte, error)
- func (c *Client) AddTLSALPN01Response(host, value string) ([]byte, error)
- func (c *Client) ClearDNSRequestHistory(host string) ([]byte, error)
- func (c *Client) ClearHTTPRequestHistory(host string) ([]byte, error)
- func (c *Client) ClearTLSALPN01RequestHistory(host string) ([]byte, error)
- func (c *Client) DNSRequestHistory(host string) ([]DNSRequest, error)
- func (c *Client) HTTPRequestHistory(host string) ([]HTTPRequest, error)
- func (c *Client) RemoveAAAARecord(host string) ([]byte, error)
- func (c *Client) RemoveARecord(host string) ([]byte, error)
- func (c *Client) RemoveCAAIssue(host string) ([]byte, error)
- func (c *Client) RemoveDNS01Response(host string) ([]byte, error)
- func (c *Client) RemoveDNSAccount01Response(accountURL, host string) ([]byte, error)
- func (c *Client) RemoveHTTP01Response(token string) ([]byte, error)
- func (c *Client) RemoveHTTPRedirect(path string) ([]byte, error)
- func (c *Client) RemoveServfailResponse(host string) ([]byte, error)
- func (c *Client) RemoveTLSALPN01Response(host string) ([]byte, error)
- func (c *Client) SetDefaultIPv4(addr string) ([]byte, error)
- func (c *Client) SetDefaultIPv6(addr string) ([]byte, error)
- func (c *Client) TLSALPN01RequestHistory(host string) ([]TLSALPN01Request, error)
- type DNSRequest
- type HTTPRequest
- type TLSALPN01Request
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 is an HTTP client for https://github.com/letsencrypt/challtestsrv's management interface (test/chall-test-srv).
func NewClient ¶
NewClient creates a new Client using the provided baseURL, or defaults to http://10.77.77.77:8055 if none is provided.
func (*Client) AddAAAARecord ¶
AddAAAARecord adds a mock AAAA response to the challenge server's DNS interface for the given host and IPv6 addresses. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) AddARecord ¶
AddARecord adds a mock A response to the challenge server's DNS interface for the given host and IPv4 addresses. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) AddCAAIssue ¶
AddCAAIssue adds a mock CAA response to the challenge server's DNS interface. The mock CAA response will contain one policy with an "issue" tag specifying the provided value. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) AddDNS01Response ¶
AddDNS01Response adds an ACME DNS-01 challenge response for the provided host to the challenge test server's DNS interfaces. The value is hashed and base64-encoded using RawURLEncoding, and served for TXT queries to _acme-challenge.<host>. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) AddDNSAccount01Response ¶ added in v0.20250922.0
AddDNSAccount01Response adds an ACME DNS-ACCOUNT-01 challenge response for the provided host to the challenge test server's DNS interfaces. The TXT record name is constructed using the accountURL, and the TXT record value is the base64url encoded SHA-256 hash of the provided value. Any failure returns an error that includes the relevant operation and the payload.
func (*Client) AddHTTP01Response ¶
AddHTTP01Response adds an ACME HTTP-01 challenge response for the provided token under the /.well-known/acme-challenge/ path of the challenge test server's HTTP interfaces. The given keyauth will be returned as the HTTP response body for requests to the challenge token. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) AddHTTPRedirect ¶
AddHTTPRedirect adds a redirect to the challenge server's HTTP interfaces for HTTP requests to the given path directing the client to the targetURL. Redirects are not served for HTTPS requests. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) AddServfailResponse ¶
AddServfailResponse configures the challenge test server to return SERVFAIL for all queries made for the provided host. This will override any other mocks for the host until removed with remove_servfail_response. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) AddTLSALPN01Response ¶
AddTLSALPN01Response adds an ACME TLS-ALPN-01 challenge response certificate to the challenge test server's TLS-ALPN-01 interface for the given host. The provided key authorization value will be embedded in the response certificate served to clients that initiate a TLS-ALPN-01 challenge validation with the challenge test server for the provided host. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) ClearDNSRequestHistory ¶
ClearDNSRequestHistory clears the history of DNS requests made to the challenge test server's DNS interfaces for the given host. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) ClearHTTPRequestHistory ¶
ClearHTTPRequestHistory clears the challenge server's HTTP request history for the given host. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) ClearTLSALPN01RequestHistory ¶
ClearTLSALPN01RequestHistory clears the history of TLS-ALPN-01 requests made to the challenge test server's TLS-ALPN-01 interface for the given host. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) DNSRequestHistory ¶
func (c *Client) DNSRequestHistory(host string) ([]DNSRequest, error)
DNSRequestHistory returns the history of DNS requests made to the challenge test server's DNS interfaces for the given host. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) HTTPRequestHistory ¶
func (c *Client) HTTPRequestHistory(host string) ([]HTTPRequest, error)
HTTPRequestHistory fetches the challenge server's HTTP request history for the given host.
func (*Client) RemoveAAAARecord ¶
RemoveAAAARecord removes mock AAAA response from the challenge server's DNS interface for the given host. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) RemoveARecord ¶
RemoveARecord removes a mock A response from the challenge server's DNS interface for the given host. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) RemoveCAAIssue ¶
RemoveCAAIssue removes a mock CAA response from the challenge server's DNS interface for the given host. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) RemoveDNS01Response ¶
RemoveDNS01Response removes an ACME DNS-01 challenge response for the provided host from the challenge test server's DNS interfaces. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) RemoveDNSAccount01Response ¶ added in v0.20250922.0
RemoveDNSAccount01Response removes an ACME DNS-ACCOUNT-01 challenge response for the provided host and accountURL combination from the challenge test server's DNS interfaces. The TXT record name is constructed using the accountURL. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) RemoveHTTP01Response ¶
RemoveHTTP01Response removes an ACME HTTP-01 challenge response for the provided token from the challenge test server. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) RemoveHTTPRedirect ¶
RemoveHTTPRedirect removes a redirect from the challenge server's HTTP interfaces for the given path. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) RemoveServfailResponse ¶
RemoveServfailResponse undoes the work of AddServfailResponse, removing the SERVFAIL configuration for the given host. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) RemoveTLSALPN01Response ¶
RemoveTLSALPN01Response removes an ACME TLS-ALPN-01 challenge response certificate from the challenge test server's TLS-ALPN-01 interface for the given host. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) SetDefaultIPv4 ¶
SetDefaultIPv4 sets the challenge server's default IPv4 address used to respond to A queries when there are no specific mock A addresses for the hostname being queried. Provide an empty string as the default address to disable answering A queries except for hosts that have mock A addresses added. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) SetDefaultIPv6 ¶
SetDefaultIPv6 sets the challenge server's default IPv6 address used to respond to AAAA queries when there are no specific mock AAAA addresses for the hostname being queried. Provide an empty string as the default address to disable answering AAAA queries except for hosts that have mock AAAA addresses added. Any failure returns an error that includes both the relevant operation and the payload.
func (*Client) TLSALPN01RequestHistory ¶
func (c *Client) TLSALPN01RequestHistory(host string) ([]TLSALPN01Request, error)
TLSALPN01RequestHistory returns the history of TLS-ALPN-01 requests made to the challenge test server's TLS-ALPN-01 interface for the given host. Any failure returns an error that includes both the relevant operation and the payload.
type DNSRequest ¶
type DNSRequest struct {
Question struct {
Name string `json:"Name"`
Qtype uint16 `json:"Qtype"`
Qclass uint16 `json:"Qclass"`
} `json:"Question"`
UserAgent string `json:"UserAgent"`
}
DNSRequest is a single DNS request in the request history.
type HTTPRequest ¶
type HTTPRequest struct {
URL string `json:"URL"`
Host string `json:"Host"`
HTTPS bool `json:"HTTPS"`
ServerName string `json:"ServerName"`
UserAgent string `json:"UserAgent"`
}
HTTPRequest is a single HTTP request in the request history.
type TLSALPN01Request ¶
type TLSALPN01Request struct {
ServerName string `json:"ServerName"`
SupportedProtos []string `json:"SupportedProtos"`
}
TLSALPN01Request is a single TLS-ALPN-01 request in the request history.