tlscfg

package
v1.63.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CipherSuiteNamesToIDs added in v1.33.0

func CipherSuiteNamesToIDs(cipherNames []string) ([]uint16, error)

CipherSuiteNamesToIDs returns a list of cipher suite IDs from the cipher suite names passed.

func VersionNameToID added in v1.33.0

func VersionNameToID(versionName string) (uint16, error)

VersionNameToID returns the version ID from version name

Types

type ClientFlagsConfig

type ClientFlagsConfig struct {
	Prefix string
}

ClientFlagsConfig describes which CLI flags for TLS client should be generated.

func (ClientFlagsConfig) AddFlags

func (c ClientFlagsConfig) AddFlags(flags *flag.FlagSet)

AddFlags adds flags for TLS to the FlagSet.

func (ClientFlagsConfig) InitFromViper

func (c ClientFlagsConfig) InitFromViper(v *viper.Viper) (Options, error)

InitFromViper creates tls.Config populated with values retrieved from Viper.

type Options

type Options struct {
	Enabled        bool          `mapstructure:"enabled"`
	CAPath         string        `mapstructure:"ca"`
	CertPath       string        `mapstructure:"cert"`
	KeyPath        string        `mapstructure:"key"`
	ServerName     string        `mapstructure:"server_name"` // only for client-side TLS config
	ClientCAPath   string        `mapstructure:"client_ca"`   // only for server-side TLS config for client auth
	CipherSuites   []string      `mapstructure:"cipher_suites"`
	MinVersion     string        `mapstructure:"min_version"`
	MaxVersion     string        `mapstructure:"max_version"`
	SkipHostVerify bool          `mapstructure:"skip_host_verify"`
	ReloadInterval time.Duration `mapstructure:"reload_interval"`
	// contains filtered or unexported fields
}

Options describes the configuration properties for TLS Connections.

func (*Options) Close added in v1.19.0

func (o *Options) Close() error

Close shuts down the embedded certificate watcher.

func (*Options) Config

func (o *Options) Config(logger *zap.Logger) (*tls.Config, error)

Config loads TLS certificates and returns a TLS Config.

func (*Options) ToOtelClientConfig added in v1.58.0

func (o *Options) ToOtelClientConfig() configtls.ClientConfig

func (*Options) ToOtelServerConfig added in v1.62.0

func (o *Options) ToOtelServerConfig() *configtls.ServerConfig

ToOtelServerConfig provides a mapping between from Options to OTEL's TLS Server Configuration.

type ServerFlagsConfig

type ServerFlagsConfig struct {
	Prefix                   string
	EnableCertReloadInterval bool
}

ServerFlagsConfig describes which CLI flags for TLS server should be generated.

func (ServerFlagsConfig) AddFlags

func (c ServerFlagsConfig) AddFlags(flags *flag.FlagSet)

AddFlags adds flags for TLS to the FlagSet.

func (ServerFlagsConfig) InitFromViper

func (c ServerFlagsConfig) InitFromViper(v *viper.Viper) (Options, error)

InitFromViper creates tls.Config populated with values retrieved from Viper.

Jump to

Keyboard shortcuts

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