tls

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package tls provides shared TLS configuration for consumoor sinks and sources.

Index

Constants

This section is empty.

Variables

View Source
var ErrDisabled = errors.New("tls: not enabled")

ErrDisabled is returned by Build when TLS is not enabled.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Enabled enables TLS for the connection.
	Enabled bool `yaml:"enabled"`
	// CAFile is the path to a PEM-encoded CA certificate file used to
	// verify the server's certificate.
	CAFile string `yaml:"caFile"`
	// CertFile is the path to a PEM-encoded client certificate file for
	// mutual TLS authentication.
	CertFile string `yaml:"certFile"`
	// KeyFile is the path to a PEM-encoded client private key file for
	// mutual TLS authentication.
	KeyFile string `yaml:"keyFile"`
	// InsecureSkipVerify disables server certificate verification.
	InsecureSkipVerify bool `yaml:"insecureSkipVerify"`
}

Config configures TLS for a connection. When Enabled is true with no other fields, it behaves the same as the previous bare tls: true setting.

func (*Config) Build

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

Build constructs a *tls.Config from the settings. Returns ErrDisabled when TLS is not enabled. The returned config always sets MinVersion to TLS 1.2.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks the TLS configuration for errors.

Jump to

Keyboard shortcuts

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