xtls

package
v0.25.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyCert = errors.New("both CA cert and cert key must be set")
)

Functions

This section is empty.

Types

type ConfigBuilder

type ConfigBuilder struct {
	// contains filtered or unexported fields
}

func NewConfigBuilder

func NewConfigBuilder() ConfigBuilder

NewConfigBuilder returns new TLSConfigBuilder builder. It helps to set up the tls config.

func (ConfigBuilder) AppendCARoot

func (b ConfigBuilder) AppendCARoot(caCert string) error

AppendCARoot appends certificates to the tls config. If caCert is a path to a PEM encoded file, it reads and appends the content to the tls config. If RootCAs is nil, TLS uses the host's root CA set.

func (ConfigBuilder) AppendX509KeyPair

func (b ConfigBuilder) AppendX509KeyPair(caCert, certKey string) error

AppendX509KeyPair appends CA cert and key to the tls config. if either is a path to an encoded PEM file, the contents of the file are read first and then the contents are added to the tls config.

func (ConfigBuilder) Build

func (b ConfigBuilder) Build() *tls.Config

Build returns built tls config.

func (ConfigBuilder) SetSkipVerify added in v0.19.2

func (b ConfigBuilder) SetSkipVerify(val bool)

Jump to

Keyboard shortcuts

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