tlsprovider

package
v0.5.0-dev Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PersistedCertFileName = "gonetsim-cert.pem"
	PersistedKeyFileName  = "gonetsim-key.pem"
	PersistedCAFileName   = "gonetsim-ca.pem"
)

Variables

This section is empty.

Functions

func GenerateSelfSigned

func GenerateSelfSigned(opts SelfSignedOptions) (tls.Certificate, error)

func GenerateSelfSignedWithCA

func GenerateSelfSignedWithCA(opts SelfSignedOptions) (certPEM []byte, keyPEM []byte, caPEM []byte, err error)

Types

type Config

type Config struct {
	CertFile string
	KeyFile  string

	// controls how the fallback self-signed cert is generated
	// when the cert or key aren't provided
	SelfSigned SelfSignedOptions

	// defaults to tls.VersionTLS12 when zero.
	MinVersion uint16
}

func (Config) Regenerate

func (c Config) Regenerate() error

func (Config) TLSConfig

func (c Config) TLSConfig() (*tls.Config, error)

func (Config) Validate

func (c Config) Validate() error

type SelfSignedOptions

type SelfSignedOptions struct {
	DNSNames []string
	IPs      []net.IP
	ValidFor time.Duration
}

Jump to

Keyboard shortcuts

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