tls

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OCSP verification = iota + 1
	CRL
)

Variables

View Source
var ErrInvalidCertVerification = errors.New("invalid certificate verification method")

ErrInvalidCertVerification represents an error during the cert verification method loading. Supported are OCSP and CRL verification methods.

Functions

func ClientCert

func ClientCert(conn net.Conn) (x509.Certificate, error)

ClientCert returns client certificate.

func Load

func Load(c *Config) (*tls.Config, error)

Load return a TLS configuration that can be used in TLS servers.

func SecurityStatus

func SecurityStatus(c *tls.Config) string

SecurityStatus returns log message from TLS config.

Types

type Config

type Config struct {
	CertFile     string `env:"CERT_FILE"      envDefault:""`
	KeyFile      string `env:"KEY_FILE"       envDefault:""`
	ServerCAFile string `env:"SERVER_CA_FILE" envDefault:""`
	ClientCAFile string `env:"CLIENT_CA_FILE" envDefault:""`
	Validator    verifier.Validator
}

func NewConfig

func NewConfig(opts env.Options) (Config, error)

Directories

Path Synopsis
crl

Jump to

Keyboard shortcuts

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