clienttls

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCiphers

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

ParseCiphers returns a `[]uint16` by received `[]string` key that represents ciphers from crypto/tls. If some of ciphers in received list doesn't exists ParseCiphers returns nil with error

func ParseTLSVersion

func ParseTLSVersion(version string) (uint16, error)

ParseTLSVersion returns a `uint16` by received version string key that represents tls version from crypto/tls. If version isn't supported ParseTLSVersion returns 0 with error

Types

type ClientConfig

type ClientConfig struct {
	TLSCA              string `yaml:"tls_ca" toml:"tls_ca"`
	TLSCert            string `yaml:"tls_cert" toml:"tls_cert"`
	TLSKey             string `yaml:"tls_key" toml:"tls_key"`
	TLSKeyPwd          string `yaml:"tls_key_pwd" toml:"tls_key_pwd"`
	InsecureSkipVerify bool   `yaml:"tls_skip_verify" toml:"tls_skip_verify"`
	ServerName         string `yaml:"tls_server_name" toml:"tls_server_name"`
	TLSMinVersion      string `yaml:"tls_min_version" toml:"tls_min_version"`
	TLSMaxVersion      string `yaml:"tls_max_version" toml:"tls_max_version"`
}

ClientConfig represents the standard client TLS config.

func (*ClientConfig) TLSConfig

func (c *ClientConfig) TLSConfig() (*tls.Config, error)

TLSConfig returns a tls.Config, may be nil without error if TLS is not configured.

Jump to

Keyboard shortcuts

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