certs

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: AGPL-3.0 Imports: 27 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package certs is the node's certificate source (engine.CertSource): ACME for a domain and a persisted self-signed certificate whose SHA-256 pin the panel puts into subscription URIs.

acme_domain uses golang.org/x/crypto/acme/autocert, one Manager per server name, cache in the state dir. The HostPolicy accepts exactly that name. TLS-ALPN-01 is answered by whatever TLS listener asks Cert.GetCertificate (the engine's own TCP 443 listener, see hysteria2), so that listener must be reachable on 443. HTTP-01 is answered on :80 when it is free; otherwise only TLS-ALPN-01 is offered. acme_ip is not supported yet.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

type Source struct {
	// DirectoryURL is the ACME directory; empty means Let's Encrypt production (use staging first).
	DirectoryURL string
	// HTTPAddr is where HTTP-01 is served; default ":80".
	HTTPAddr string
	Log      *slog.Logger
	// contains filtered or unexported fields
}

Source implements engine.CertSource. Create it with New; the exported fields may be set before the first Acquire.

func New

func New(stateDir string) *Source

New keeps certificates and ACME state under stateDir (created 0700).

func (*Source) Acquire

func (s *Source) Acquire(ctx context.Context, inboundID string, t plugin.TLS) (engine.Cert, error)

Acquire returns the live certificate source for an inbound. Self-signed certificates are created on first use and reused afterwards (same pin). ACME certificates are fetched lazily on the first handshake and in the background right after Acquire; Info is zero until one exists.

func (*Source) Release

func (s *Source) Release(inboundID string)

Release forgets the inbound's ACME claim; the last release of a name stops its renewals and, when no ACME name is left, the :80 listener. Self-signed files stay.

Jump to

Keyboard shortcuts

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