tlsx

package
v6.7.3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 6 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 {
	UseTLS             bool
	TLSCA              string
	TLSCert            string
	TLSKey             string
	TLSKeyPwd          string
	InsecureSkipVerify bool
	ServerName         string
	TLSMinVersion      string
	TLSMaxVersion      string
}

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.

type ServerConfig

type ServerConfig struct {
	TLSCert            string
	TLSKey             string
	TLSKeyPwd          string
	TLSAllowedCACerts  []string
	TLSCipherSuites    []string
	TLSMinVersion      string
	TLSMaxVersion      string
	TLSAllowedDNSNames []string
}

ServerConfig represents the standard server TLS config.

func (*ServerConfig) TLSConfig

func (c *ServerConfig) 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