tls

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package tls provides TLS certificate management for ShellGate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSelfSigned

func GenerateSelfSigned(cfg SelfSignedConfig) (*tls.Config, string, error)

GenerateSelfSigned creates a self-signed ED25519 certificate. Returns the TLS config and the certificate's SHA-256 fingerprint.

func LoadCertificate

func LoadCertificate(certFile, keyFile string) (*tls.Config, error)

LoadCertificate loads a TLS certificate from the given cert and key files.

func NewAutoTLS

func NewAutoTLS(cfg AutoTLSConfig) (*tls.Config, *autocert.Manager, error)

NewAutoTLS creates a TLS configuration that automatically obtains and renews Let's Encrypt certificates for the given domain.

Types

type AutoTLSConfig

type AutoTLSConfig struct {
	Domain   string
	CacheDir string
}

AutoTLSConfig holds the configuration for automatic Let's Encrypt certificates.

type SelfSignedConfig

type SelfSignedConfig struct {
	CertDir  string
	Hosts    []string // IP addresses and hostnames
	ValidFor time.Duration
}

SelfSignedConfig holds the configuration for self-signed certificate generation.

Jump to

Keyboard shortcuts

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