tlsconfig

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package tlsconfig provides TLS configuration parsing and management for the API server. It supports loading configuration from environment variables or explicit values, and converts them to Go's tls.Config for use with HTTPS servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatCipherSuites

func FormatCipherSuites(ciphers []uint16) string

FormatCipherSuites returns a human-readable string of cipher suite names Returns "default" if the slice is empty (Go's defaults will be used)

func FormatCurvePreferences

func FormatCurvePreferences(curves []tls.CurveID) string

FormatCurvePreferences returns a human-readable string of curve names Returns "default" if the slice is empty (Go's defaults will be used)

func GetCipherSuiteName

func GetCipherSuiteName(id uint16) string

GetCipherSuiteName returns the name of a cipher suite given its ID Uses Go's built-in cipher suite info

func GetCurveName

func GetCurveName(id tls.CurveID) string

GetCurveName returns the name of a curve given its ID

func GetTLSVersionName

func GetTLSVersionName(version uint16) string

GetTLSVersionName returns a human-readable name for a TLS version

func HasEnvOverrides

func HasEnvOverrides() bool

HasEnvOverrides checks if any TLS configuration is set via direct environment variables. This is used to detect operator-injected configuration which should completely override ConfigMap-based configuration to avoid mixing incompatible settings.

Types

type Config

type Config struct {
	MinTLSVersion    string // e.g., "1.2", "1.3"
	CipherSuites     string // Comma-separated list of IANA cipher suite names or numeric IDs
	CurvePreferences string // Comma-separated list of curve names (e.g., "X25519,P256")
}

Config holds TLS configuration that can be loaded from environment variables

func LoadFromEnv

func LoadFromEnv(getenv func(string) string) *Config

LoadFromEnv loads TLS configuration from environment variables This allows the configuration to be provided via ConfigMap in Kubernetes or injected by the Tekton operator on OpenShift

func New

func New(minVersion, cipherSuites, curvePreferences string) *Config

New creates a TLS Config from explicit values

func (*Config) ToTLSConfig

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

ToTLSConfig converts the configuration to Go's tls.Config

Jump to

Keyboard shortcuts

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