Challtestsrv
Small TEST-ONLY server for mock DNS & responding to HTTP-01, DNS-01, and TLS-ALPN-01 ACME challenges.
Install / Use
/learn @letsencrypt/ChalltestsrvREADME
Challenge Test Server
The challtestsrv package offers a library that can be used by test
code to respond to HTTP-01, DNS-01, and TLS-ALPN-01 ACME challenges. The
challtestsrv package can also be used as a DNS server letting
developers configure A, AAAA, CNAME, and CAA DNS data for specific hostnames.
The DNS server will resolve up to one level of CNAME aliasing for accepted
DNS request types.
Important note: The challtestsrv library is for TEST USAGE
ONLY. It is trivially insecure, offering no authentication. Only use
challtestsrv in a controlled test environment.
For example this package is used by the Boulder
load-generator
command to manage its own in-process HTTP-01 challenge server.
Usage
Create a challenge server responding to HTTP-01 challenges on ":8888" and DNS-01 challenges on ":9999" and "10.0.0.1:9998":
import "github.com/letsencrypt/challtestsrv"
challSrv, err := challtestsrv.New(challtestsrv.Config{
HTTPOneAddrs: []string{":8888"},
DNSAddrs: []string{":9999", "10.0.0.1:9998"},
})
if err != nil {
panic(err)
}
Run the Challenge server and subservers:
// Start the Challenge server in its own Go routine
go challSrv.Run()
Add an HTTP-01 response for the token "aaa" and the value "bbb", defer
cleaning it up again:
challSrv.AddHTTPOneChallenge("aaa", "bbb")
defer challSrv.DeleteHTTPOneChallenge("aaa")
Add a DNS TXT response for the host "_acme-challenge.example.com." and the
value "bbb", defer cleaning it up again:
challSrv.AddDNSTXTRecord("_acme-challenge.example.com.", "bbb")
defer challSrv.DeleteDNSTXTRecord("_acme-challenge.example.com.")
Get the history of HTTP requests processed by the challenge server for the host "example.com":
requestHistory := challSrv.RequestHistory("example.com", challtestsrv.HTTPRequestEventType)
Clear the history of HTTP requests processed by the challenge server for the host "example.com":
challSrv.ClearRequestHistory("example.com", challtestsrv.HTTPRequestEventType)
Stop the Challenge server and subservers:
// Shutdown the Challenge server
challSrv.Shutdown()
For more information on the package API see Godocs and the associated package sourcecode.
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
