tlsutil

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package tlsutil generates and manages TLS certificates for Pando's HTTP server. It creates a self-signed certificate stored in the user's data directory so that the PWA installation prompt is available when accessing Pando remotely.

Index

Constants

View Source
const (

	// LoopbackServerName is the DNS name the generated certificate always
	// carries, so callers can pin it while connecting to 127.0.0.1.
	LoopbackServerName = "localhost"
)

Variables

This section is empty.

Functions

func LoadPinnedLoopbackTLSConfig added in v1.2.7

func LoadPinnedLoopbackTLSConfig(certPath string) (*tls.Config, error)

LoadPinnedLoopbackTLSConfig builds a TLS client config that trusts only the certificate stored at certPath and verifies it against localhost while allowing the caller to connect to 127.0.0.1.

Types

type CertPaths

type CertPaths struct {
	CertFile string
	KeyFile  string
}

CertPaths holds the file paths for the TLS certificate and private key.

func EnsureCert

func EnsureCert(dataDir string) (CertPaths, error)

EnsureCert returns paths to a TLS cert/key pair inside dataDir. If the files already exist they are reused; otherwise a new self-signed ECDSA P-256 certificate is generated and persisted.

Jump to

Keyboard shortcuts

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