tls

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2025 License: MIT Imports: 11 Imported by: 1

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

func GenerateTLS(validFor time.Duration, hosts []string) (cert, key []byte, err error)

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.

Jump to

Keyboard shortcuts

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