tlsconfig

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// AllTLSVersions has all supported flag values
	AllTLSVersions = map[string]uint16{
		"":       0,
		"ssl3":   tls.VersionSSL30,
		"tls1.0": tls.VersionTLS10,
		"tls1.1": tls.VersionTLS11,
		"tls1.2": tls.VersionTLS12,
		"tls1.3": tls.VersionTLS13,
	}
)

Functions

func Create

func Create(cert, key []byte, getCertificate GetCertificateFunc, insecureCiphers bool, tlsMinVersion uint16, tlsMaxVersion uint16) (*tls.Config, error)

Create returns tls.Config for given app configuration

func FlagUsage

func FlagUsage(minOrMax string) string

FlagUsage returns string with explanation how to use the CLI flag

func ValidateTLSVersions

func ValidateTLSVersions(min, max string) error

ValidateTLSVersions returns error if the provided TLS versions config values are not valid

Types

type GetCertificateFunc

type GetCertificateFunc func(*tls.ClientHelloInfo) (*tls.Certificate, error)

GetCertificateFunc returns the certificate to be used for given domain

Jump to

Keyboard shortcuts

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