Documentation ¶
Overview ¶
Package tls provides config and flags for building TLS configurations for servers and clients.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CAConfig ¶
type CAConfig struct {
Certificate string
}
CAConfig represents a CA certificate.
func (CAConfig) Load ¶
func (f CAConfig) Load(_ context.Context, fileReader FileReader) ([]*x509.Certificate, error)
Load loads the CA certificates. If fileReader is nil, this uses ioutil.ReadFile.
type CertConfig ¶
CertConfig represent a TLS certificate and its key.
func (CertConfig) Load ¶
func (f CertConfig) Load(_ context.Context, fileReader FileReader) (*tls.Certificate, error)
Load loads the certificate. If fileReader is nil, this uses ioutil.ReadFile.
type Config ¶
type Config struct { Store string ClientCert CertConfig ClientCA CAConfig ServerCert CertConfig ServerCA CAConfig }
Config is the configuration for client and server TLS.
func (Config) BuildClientConfig ¶
BuildClientConfig builds a TLS config suitable for use by clients.
func (Config) BuildServerConfig ¶
BuildServerConfig builds a TLS config suitable for use by servers.
type FileReader ¶
FileReader reads a file and returns its bytes.
Click to show internal directories.
Click to hide internal directories.