tlsconfig

package module
v0.0.0-...-8208f09 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2020 License: MIT Imports: 5 Imported by: 4

README

tlsconfig

Helper for generating tls.Config files without having to pull in etcd

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertPoolFromFile

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

CertPoolFromFile loads a single X.509 file and creates a CertPool from it.

func LoadTLSCertificateAndPrivateKey

func LoadTLSCertificateAndPrivateKey(
	certPath, keyPath string) ([]tls.Certificate, error)

LoadTLSCertificateAndPrivateKey loads an tls.Certificate from a private and public key file in PEM format.

func LoadX509Certificate

func LoadX509Certificate(certPath string) (*x509.Certificate, error)

LoadX509Certificate loads an X.509 certificate from a PEM encoded file.

func LoadX509Certificates

func LoadX509Certificates(certPath string) ([]*x509.Certificate, error)

LoadX509Certificates loads a list of X.509 certificates from a PEM encoded file.

func TLSConfigWithRootAndClientCA

func TLSConfigWithRootAndClientCA(
	rootCaPath, clientCaPath string) (*tls.Config, error)

TLSConfigWithRootAndClientCA creates a TLS config with the root and client CAs filled in.

func TLSConfigWithRootAndClientCAAndCert

func TLSConfigWithRootAndClientCAAndCert(
	rootCaPath, clientCaPath, certPath, keyPath string) (*tls.Config, error)

TLSConfigWithRootAndClientCAAndCert creates a TLS config with the root and client CAs filled in as well as a TLS certificate to authenticate to peers with.

func TLSConfigWithRootCA

func TLSConfigWithRootCA(rootCaPath string) (*tls.Config, error)

TLSConfigWithRootCA creates a TLS config with only the root CA filled in.

func TLSConfigWithRootCAAndCert

func TLSConfigWithRootCAAndCert(
	rootCaPath, certPath, keyPath string) (*tls.Config, error)

TLSConfigWithRootCAAndCert creates a TLS config with the root CA filled in as well as a TLS certificate to authenticate to peers with.

Types

This section is empty.

Jump to

Keyboard shortcuts

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