tlsconf

package
v2.0.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: MIT Imports: 10 Imported by: 9

Documentation

Overview

Package tlsconf provides standard JSON configs for server and client TLS listeners, extending github.com/One-com/gone/jconf It relies on the presence of and openssl executable to parse OpenSSL ciphers strings - if you use Cipher Format "openssl"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTLSClientConfig

func GetTLSClientConfig(cfg *TLSClientConfig) (tlsConf *tls.Config, err error)

GetTLSClientConfig creates a tls.Config object from configuration

func GetTLSServerConfig

func GetTLSServerConfig(cfg *TLSServerConfig) (tlsConf *tls.Config, err error)

GetTLSServerConfig creates a tls.Config object from configuration

Types

type CertConfig

type CertConfig struct {
	KeyPEMFile string
	CrtPEMFile string
}

CertConfig holds file path names for x509 certificates and key PEM files.

type CipherConfig

type CipherConfig struct {
	Format  string
	Ciphers *jconf.MandatorySubConfig
}

CipherConfig specifies a group of TLS ciphers and the format of the cipher specification Available formats are: "hex": A string with space separated 16-bit hexadecimal numbers "openssl": An OpenSSL cipherstring (requires an openssl binary present)

type TLSClientConfig

type TLSClientConfig struct {
	RootCAs            map[string]string
	InsecureSkipVerify bool
	Certificates       map[string]CertConfig
	CipherSuites       *CipherConfig
	MinVersion         string
	MaxVersion         string
	ServerName         string
}

TLSClientConfig holds TLS configuration relevant for TLS clients

type TLSServerConfig

type TLSServerConfig struct {
	Certificates             map[string]CertConfig
	CipherSuites             *CipherConfig
	ClientCAs                map[string]string
	ClientAuthType           string
	ClientSessionCacheSize   int
	PreferServerCipherSuites bool
	MinVersion               string
	MaxVersion               string
}

TLSServerConfig holds TLS configuration relevant for TLS servers

Jump to

Keyboard shortcuts

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