autocert

package module
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 13 Imported by: 1

README

autocert

A package that makes some improvements to golang.org/x/crypto/acme/autocert.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Domains []string
	IPAddrs []string

	ForceALPN bool
	ForceHTTP bool

	Cache     certmgr.Cache
	Client    *acme.Client
	TLSConfig *tls.Config

	OnCreateCert func(cert *tls.Certificate)
}

Config contains configuration about ACME Manager.

type Listener added in v1.3.0

type Listener struct {
	// contains filtered or unexported fields
}

Listener is the ACME listener, it will wrap the connection.

func Listen

func Listen(network, address string, config *Config) (*Listener, error)

Listen is used to listen a TLS listener with ACME.

func ListenContext

func ListenContext(ctx context.Context, network, address string, config *Config) (*Listener, error)

ListenContext is used to listen a TLS listener with context.

func NewListener added in v1.1.0

func NewListener(ctx context.Context, listener net.Listener, config *Config) (*Listener, error)

NewListener is used to create ACME listener from income listener.

func (*Listener) Accept added in v1.3.0

func (l *Listener) Accept() (net.Conn, error)

func (*Listener) Addr added in v1.3.0

func (l *Listener) Addr() net.Addr

func (*Listener) Close added in v1.3.0

func (l *Listener) Close() error

func (*Listener) GetCertificate added in v1.3.0

func (l *Listener) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)

GetCertificate is the tls.Config.GetCertificate hook.

func (*Listener) Preprovision added in v1.3.0

func (l *Listener) Preprovision(ctx context.Context) error

Preprovision is used to get certificate before accept the first connection.

func (*Listener) TLSConfig added in v1.3.0

func (l *Listener) TLSConfig() *tls.Config

TLSConfig is used to get internal TLS config.

Directories

Path Synopsis
Package acme provides an implementation of the Automatic Certificate Management Environment (ACME) spec, most famously used by Let's Encrypt.
Package acme provides an implementation of the Automatic Certificate Management Environment (ACME) spec, most famously used by Let's Encrypt.
Package certmgr provides automatic access to certificates from Let's Encrypt and any other ACME-based CA.
Package certmgr provides automatic access to certificates from Let's Encrypt and any other ACME-based CA.
internal/acmetest
Package acmetest provides types for testing acme and autocert packages.
Package acmetest provides types for testing acme and autocert packages.

Jump to

Keyboard shortcuts

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