tlsconfig

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CipherSuitesToUint16

func CipherSuitesToUint16(ciphers []string) ([]uint16, []string, error)

CipherSuitesToUint16 for a given list of ciphers returns list of corresponding ids, list of insecure ciphers if cipher is unknown, it will return an error

func ParseClientAuthType

func ParseClientAuthType(ClientAuth string) (tls.ClientAuthType, error)

func ParseClientTLSConfig

func ParseClientTLSConfig(serverTLSConfig *TLSConfig) (*tls.Config, []string, error)

ParseClientTLSConfig parses TLSConfig as it should be used for HTTPS client mTLS and returns &tls.Config, list of warnings or error if parsing has failed. At this moment warnings are only about insecure ciphers

func ParseCurves

func ParseCurves(curveNames []string) ([]tls.CurveID, error)

ParseCurves returns list of tls.CurveIDs that can be passed to tls.Config or error if they are not supported ParseCurves also deduplicate input list

func ParseServerTLSConfig

func ParseServerTLSConfig(serverTLSConfig, clientTLSConfig *TLSConfig) (*tls.Config, []string, error)

ParseServerTLSConfig parses server and client TLSConfig struct and returns &tls.Config, list of warnings or error if parsing has failed. At this moment warnings are only about insecure ciphers

func ParseTLSVersion

func ParseTLSVersion(tlsVersion string) (uint16, error)

Types

type ClientCertificatePairs

type ClientCertificatePairs struct {
	CertFile       string `mapstructure:"certFile"`
	PrivateKeyFile string `mapstructure:"privateKeyFile"`
}

type TLSConfig

type TLSConfig struct {
	CACertFiles      []string                 `mapstructure:"caCertFiles"`
	CertificatePairs []ClientCertificatePairs `mapstructure:"certificatePairs"`
	ClientAuth       string                   `mapstructure:"clientAuth"`

	ServerName         string   `mapstructure:"serverName"`
	InsecureSkipVerify bool     `mapstructure:"insecureSkipVerify"`
	MinTLSVersion      string   `mapstructure:"minTLSVersion"`
	MaxTLSVersion      string   `mapstructure:"maxTLSVersion"`
	CipherSuites       []string `mapstructure:"cipherSuites"`
	Curves             []string `mapstructure:"curves"`
}

Jump to

Keyboard shortcuts

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