tlsconfig

package
v0.0.0-...-4e290a4 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertSetup

func CertSetup() (serverTLSConf *tls.Config, clientTLSConf *tls.Config, caBytes, certPEMBytes, keyPEMBytes []byte, err error)

CertSetup

func CreateTLSConfig

func CreateTLSConfig(caCert, cert, key string) (*tls.Config, error)

CreateTLSConfig creates a tls.config from the CA, cert and client key files

func CreateTLSServerConfig

func CreateTLSServerConfig(useClientAuth bool, caCert string) (*tls.Config, error)

CreateTLSServerConfig creates a tls.Config f rom the CA certificate

func GetCACertPoolFromFile

func GetCACertPoolFromFile(pemFile string) (*x509.CertPool, error)

GetCACertPoolFromFile - Returns an x509 certificate pool from a specified pem file location

func GetCertPoolFromDir

func GetCertPoolFromDir(path string) (*x509.CertPool, error)

GetCertPoolFromDir - Returns an x509 certificate pool from the specified directory path

func NewCoreTLSConfig

func NewCoreTLSConfig() *tls.Config

NewCoreTLSConfig - creates a new TLS config with common basic setup

func ParseCertificate

func ParseCertificate(certFile string) (cert *x509.Certificate, err error)

ParseCertificate read a certificate from a PEM file

Types

This section is empty.

Jump to

Keyboard shortcuts

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