devtls

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package devtls provides a shared, in-memory self-signed TLS certificate generator for gopherstack's opt-in/mandatory dev HTTPS listeners.

It is lifted out of cli.go's original generateSelfSignedCert (used by the main port's opt-in TLS mode) so that services/azurearm -- which must serve its ARM/AAD-discovery listener over HTTPS unconditionally, see AZURE.md section 10.8 -- can share the exact same cert-generation logic instead of duplicating it. cli.go now calls GenerateSelfSignedCert instead of defining its own copy.

Index

Constants

View Source
const DefaultValidity = 365 * 24 * time.Hour

DefaultValidity is the validity window of a generated certificate.

Variables

This section is empty.

Functions

func GenerateSelfSignedCert

func GenerateSelfSignedCert(hosts ...string) (tls.Certificate, error)

GenerateSelfSignedCert creates an in-memory self-signed certificate valid for localhost/127.0.0.1/::1, plus any extra DNS names or IP addresses passed in hosts (each entry is tried as an IP first, falling back to a DNS name). Suitable for an opt-in or mandatory dev HTTPS listener -- never for production use.

func GenerateSelfSignedCertPEM

func GenerateSelfSignedCertPEM(hosts ...string) ([]byte, []byte, error)

GenerateSelfSignedCertPEM is the PEM-returning variant of GenerateSelfSignedCert, used by callers (e.g. the terraform test harness) that need to write the certificate to disk for a child process (such as `tofu`/`terraform`) to trust via SSL_CERT_FILE.

Types

This section is empty.

Jump to

Keyboard shortcuts

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