tlsutil

package
v0.1.163 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Inspired by similar approach in: https://github.com/helm/helm (Apache 2.0 License).

Inspired by similar approach in: https://github.com/helm/helm (Apache 2.0 License).

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.

Types

type Options

type Options struct {
	CaCertFile string
	// If either the KeyFile or CertFile is empty, ClientConfig() will not load them.
	KeyFile  string
	CertFile string
	// Client-only options
	InsecureSkipVerify bool
}

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