Documentation
¶
Overview ¶
Package certs keeps a TLS certificate for every public hostname (§5.0.2). The controller is the ACME client (HTTP-01 through Traefik) and hands the certificates to Traefik in its dynamic config. Until a real certificate is issued, or when ACME fails, a self-signed placeholder keeps HTTPS working.
Index ¶
- Constants
- Variables
- type Config
- type Manager
- func (m *Manager) Kick()
- func (m *Manager) List() []View
- func (m *Manager) Load(ctx context.Context) error
- func (m *Manager) Pairs() []Pair
- func (m *Manager) Pin(host string) string
- func (m *Manager) Reconcile(ctx context.Context)
- func (m *Manager) Renew(ctx context.Context, host string) error
- func (m *Manager) Run(ctx context.Context)
- func (m *Manager) SelfSignedBundle(hosts ...string) string
- func (m *Manager) SelfSignedPEM(host string) string
- func (m *Manager) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (m *Manager) SetHosts(hosts []string)
- type Pair
- type View
Constants ¶
const ( StatusValid = "valid" // issued by ACME StatusPending = "pending" // self-signed placeholder, ACME attempt due StatusFailed = "failed" // ACME failed, retrying with backoff StatusRateLimited = "rate_limited" // the CA rate-limited us (§5.0.2) StatusSelfSigned = "self_signed" // ACME disabled IssuerACME = "acme" IssuerSelfSigned = "self-signed" // TopicUpdated carries a View whenever a certificate changes. TopicUpdated = "certificate.updated" // ChallengePrefix is routed from Traefik's HTTP entrypoint to the controller. ChallengePrefix = "/.well-known/acme-challenge/" )
Status values.
Variables ¶
var ErrUnknownHost = errors.New("no certificate is managed for this host")
ErrUnknownHost is returned by Renew for hosts that need no certificate.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) Pin ¶
Pin returns the public-key pin ("sha256//<base64>", as curl's --pinnedpubkey takes it) of host's certificate while it is self-signed, and "" once a CA issued it. Join commands carry the pin so new nodes can verify the controller on a private network where ACME cannot issue.
func (*Manager) SelfSignedBundle ¶
SelfSignedBundle concatenates the self-signed certificates of hosts (skipping CA-issued ones): what a client of the registry must trust, as Docker also fetches tokens from the dashboard host.
func (*Manager) SelfSignedPEM ¶
SelfSignedPEM returns host's certificate while it is self-signed, for clients that must be told to trust it (Docker on nodes, §5.9), else "".
type Pair ¶
type Pair struct{ CertPEM, KeyPEM string }
Pair is a PEM certificate chain and key, as Traefik takes them.
type View ¶
type View struct {
Host string `json:"host"`
Issuer string `json:"issuer"`
Status string `json:"status"`
NotAfter time.Time `json:"notAfter"`
LastError string `json:"lastError"`
Failures int `json:"failures"`
NextAttemptAt *time.Time `json:"nextAttemptAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
View is a certificate as shown in the API (never the key).