ztls

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MultiCertFormatErr = errors.New("multi cert format error")
View Source
var UnexpectCertFormatErr = errors.New("unexpect cert format error")

Functions

func Certificate

func Certificate(cert interface{}, key interface{}) (*tls.Certificate, error)

func MustCertificate

func MustCertificate(cert interface{}, key interface{}) *tls.Certificate

func MustRootCAsBytes

func MustRootCAsBytes(rootCAs []interface{}) *x509.CertPool

func MustTlsConfig

func MustTlsConfig(options ...Option) *tls.Config

func RootCAsBytes

func RootCAsBytes(rootCAs []interface{}) (*x509.CertPool, error)

func TlsConfig

func TlsConfig(options ...Option) (*tls.Config, error)

Types

type Option

type Option func(*tlsWith)

Option is a tlsWith configurator to be supplied to NewtlsWith() function.

func MustCerts

func MustCerts(rootCa string, certFile string, keyFile string) []Option

func WithCertificates

func WithCertificates(certificates []tls.Certificate) Option

WithCertificates sets the Certificates

func WithClientAuth

func WithClientAuth(clientauth tls.ClientAuthType) Option

WithClientAuth sets the ClientAuth

func WithClientCAs

func WithClientCAs(clientcas *x509.CertPool) Option

WithClientCAs sets the ClientCAs

func WithInsecureSkipVerify

func WithInsecureSkipVerify(insecureskipverify bool) Option

WithInsecureSkipVerify sets the InsecureSkipVerify

func WithRootCAs

func WithRootCAs(rootcas *x509.CertPool) Option

WithRootCAs sets the RootCAs

Jump to

Keyboard shortcuts

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