network

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ACMETLSConfig

func ACMETLSConfig(domain, email, storageDir string) (*tls.Config, error)

ACMETLSConfig obtains (and thereafter auto-renews) a Let's Encrypt certificate for the given domain using the HTTP-01 challenge, and returns a *tls.Config ready to wrap a listener with tls.NewListener.

HTTP-01 requires TCP port 80 to be free and reachable from the internet: certmagic's HTTP solver transiently binds :80 for the duration of each challenge (issuance and renewal), then releases it. TLS-ALPN is disabled because the panel/sub servers do not necessarily listen on :443.

Certificates are persisted under storageDir so they survive restarts and we avoid re-issuing (which would otherwise hit Let's Encrypt rate limits).

func NewAutoHttpsConn

func NewAutoHttpsConn(conn net.Conn) net.Conn

func NewAutoHttpsListener

func NewAutoHttpsListener(listener net.Listener) net.Listener

func NewTLSConfig added in v1.5.4

func NewTLSConfig(certFile, keyFile, domain string) (*tls.Config, error)

Types

type AutoHttpsConn

type AutoHttpsConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*AutoHttpsConn) Read

func (c *AutoHttpsConn) Read(buf []byte) (int, error)

type AutoHttpsListener

type AutoHttpsListener struct {
	net.Listener
}

func (*AutoHttpsListener) Accept

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

Jump to

Keyboard shortcuts

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