tls

package
Version: v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package tls handles options for TLS (https) requests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptionsChanged

func OptionsChanged(conf, oldConf *config.Config) bool

OptionsChanged will return true if the TLS options for any origin is different between configs

Types

type CertSwapper

type CertSwapper struct {
	*sync.Mutex
	Certificates []tls.Certificate
}

CertSwapper is used by a TLSConfig to dynamically update the running Listener's Certificate list This allows Trickster to load and unload TLS certificate configs without restarting the process

func NewSwapper

func NewSwapper(certList []tls.Certificate) *CertSwapper

NewSwapper returns a new *CertSwapper based on the provided certList

func (*CertSwapper) GetCert

func (c *CertSwapper) GetCert(clientHello *tls.ClientHelloInfo) (*tls.Certificate, error)

GetCert returns the best-matching certificate for the provided clientHello

func (*CertSwapper) SetCerts

func (c *CertSwapper) SetCerts(certs []tls.Certificate)

SetCerts safely updates the certs list for the subject *CertSwapper

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to