Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadServerTLSConfig ¶ added in v0.0.2
LoadServerTLSConfig reads the server certificate, key, and CA certificate from the given paths and returns a tls.Config for mutual TLS.
Types ¶
type Certificates ¶ added in v0.0.2
type Certificates struct {
CACertPEM []byte
CAKeyPEM []byte
ServerCertPEM []byte
ServerKeyPEM []byte
ClientCertPEM []byte
ClientKeyPEM []byte
}
Certificates holds the PEM-encoded keys and certificates needed to establish a mutually authenticated TLS connection.
func GenerateCertificates ¶ added in v0.0.2
func GenerateCertificates() (*Certificates, error)
GenerateCertificates creates a self-signed CA along with server and client certificates signed by that CA, suitable for mutual TLS.
func (*Certificates) ClientTLSConfig ¶ added in v0.0.2
func (c *Certificates) ClientTLSConfig() (*tls.Config, error)
ClientTLSConfig returns a tls.Config that presents the client certificate and verifies the server against the CA.
func (*Certificates) ServerTLSConfig ¶ added in v0.0.2
func (c *Certificates) ServerTLSConfig() (*tls.Config, error)
ServerTLSConfig returns a tls.Config that presents the server certificate and requires clients to present a certificate signed by the CA.
Click to show internal directories.
Click to hide internal directories.