Documentation
¶
Overview ¶
Package tls provides utilities for generating self-signed TLS certificates.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateTLS ¶
GenerateTLS generated a TLS certificate and key. based on https://go.dev/src/crypto/tls/generate_cert.go - `hosts`: a list of ip / dns names to include in the certificate
func GetOrGenerateTLS ¶ added in v0.11.0
func GetOrGenerateTLS(certPath, certKeyPath string, validFor time.Duration, hosts []string) (cert, key []byte, err error)
GetOrGenerateTLS tries to load a TLS certificate and key from the given paths, and if that fails, it generates a new self-signed certificate and key and saves it.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.