tlsutil

package
v2.17.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertFromFilePair

func CertFromFilePair(certFile, keyFile string) (*tls.Certificate, error)

CertFromFilePair returns an tls.Certificate containing the certificates public/private key pair from a pair of given PEM-encoded files. Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates

func CertPoolFromFile

func CertPoolFromFile(filename string) (*x509.CertPool, error)

CertPoolFromFile returns an x509.CertPool containing the certificates in the given PEM-encoded file. Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates

func ClientConfig

func ClientConfig(opts Options) (cfg *tls.Config, err error)

ClientConfig returns a TLS configuration for use by a Helm client.

func NewClientTLS

func NewClientTLS(certFile, keyFile, caFile string) (*tls.Config, error)

NewClientTLS returns tls.Config appropriate for client auth.

func NewTLSConfig

func NewTLSConfig(url, certFile, keyFile, caFile string) (*tls.Config, error)

NewTLSConfig returns tls.Config appropriate for client and/or server auth.

func ServerConfig

func ServerConfig(opts Options) (cfg *tls.Config, err error)

ServerConfig returns a TLS configuration for use by the Tiller server.

Types

type Options

type Options struct {
	CaCertFile string
	// If either the KeyFile or CertFile is empty, ClientConfig() will not load them,
	// preventing Helm from authenticating to Tiller. They are required to be non-empty
	// when calling ServerConfig, otherwise an error is returned.
	KeyFile  string
	CertFile string
	// Client-only options
	InsecureSkipVerify bool
	// Overrides the server name used to verify the hostname on the returned
	// certificates from the server.
	ServerName string
	// Server-only options
	ClientAuth tls.ClientAuthType
}

Options represents configurable options used to create client and server TLS configurations.

Jump to

Keyboard shortcuts

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