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

tlsutil

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT-0 Imports: 19 Imported by: 0

Documentation

Overview

Package tlsutil builds TLS configurations for IMAP and submission.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertificateExpiry

func CertificateExpiry(certPath string) (time.Time, error)

CertificateExpiry returns the leaf certificate's NotAfter time.

func GenerateSelfSigned

func GenerateSelfSigned(certPath, keyPath, hostname string) error

GenerateSelfSigned writes a local development certificate and key.

func RunACMEHTTP

func RunACMEHTTP(ctx context.Context, manager *autocert.Manager, addr string) error

RunACMEHTTP serves HTTP-01 challenges until ctx is cancelled.

Types

type Reloader

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

Reloader holds a manually supplied certificate and can replace it on SIGHUP.

func Load

func Load(cfg config.TLSConfig, dataDir string) (*tls.Config, *autocert.Manager, *Reloader, error)

Load returns a TLS config for the configured certificate source. It returns (nil, nil, nil, nil) when no certificate source is configured.

func NewReloader

func NewReloader(certFile, keyFile string) (*Reloader, error)

NewReloader loads certFile/keyFile and returns a reloadable certificate provider.

func (*Reloader) Config

func (r *Reloader) Config() *tls.Config

Config returns a TLS config backed by the reloadable certificate.

func (*Reloader) Reload

func (r *Reloader) Reload() error

Reload rereads the certificate and key files atomically.

Jump to

Keyboard shortcuts

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