mtls

package
v0.0.0-...-7b48451 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package mtls provides mTLS and TLS config support.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingCertOrKey       = errors.New("root ca set without certificate or key")
	ErrNoValidRootCertificate = errors.New("no valid root certificate")
	ErrMissingCertificate     = errors.New("missing certificate")
	ErrMissingKey             = errors.New("missing key")
)

Functions

func NewClientConfig

func NewClientConfig(rootPEM, certPEMBlock, keyPEMBlock []byte) (*tls.Config, error)

NewClientConfig returns a TLS configuration for use with an mTLS or TLS connection. If all parameters are empty, a nil config will be returned.

func NewServerConfig

func NewServerConfig(rootPEM, certPEMBlock, keyPEMBlock []byte) (*tls.Config, error)

NewServerConfig returns a TLS configuration for use with an mTLS or TLS connection. If a root CA PEM block is provided the configuration will be set up for mTLS, otherwise if it is empty the config will be for TLS connections. If all parameters are empty, a nil config will be returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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