Help us shape the future of Go! Take the 2026 Go Developer Survey

static

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package static is the stdlib TLS driver (ADR-0111, F74): it builds a *tls.Config from a static certificate — either operator-PROVIDED (tls.LoadX509KeyPair) or SELF-SIGNED (one multi-SAN cert this package generates with crypto/x509 and persists under the storage dir). Pure stdlib — it imports no ACME/certmagic code, so a self-signed/provided deployment pays for no TLS-automation dependency. It satisfies the internal/edge/tls Provider interface structurally (no import of the facade → no cycle).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

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

Driver serves a single static certificate (provided or self-signed).

func New

func New(selfSigned bool, certFile, keyFile, storageDir string, logger *slog.Logger) *Driver

New builds a static driver. selfSigned=false ⇒ load certFile/keyFile (provided); selfSigned=true ⇒ generate/persist a multi-SAN cert under storageDir at Manage time.

func (*Driver) Close

func (d *Driver) Close(context.Context) error

Close is a no-op for static (no background work).

func (*Driver) Manage

func (d *Driver) Manage(_ context.Context, hosts []string) error

Manage loads the provided cert, or loads-or-generates the self-signed one. hosts is the SAN set (F79 Router.Hosts() + configured hosts). Idempotent: a persisted self-signed cert whose SANs already cover hosts is reused (so a restart keeps the same cert — the selfsigned-persists rule); otherwise one multi-SAN cert is generated and persisted.

func (*Driver) TLSConfig

func (d *Driver) TLSConfig() (*tls.Config, error)

TLSConfig returns a GetCertificate-driven config advertising h2 + http/1.1.

Jump to

Keyboard shortcuts

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