Documentation ¶
Overview ¶
Package tlsdefaults provides sensible defaults for using TLS.
Index ¶
- func BuildListenerConfig(addr string, pkfile string, certfile string) (*tls.Config, error)
- func Listen(addr, pkfile, certfile string) (net.Listener, error)
- func NewListener(l net.Listener, pkfile, certfile string) (net.Listener, error)
- func NewListenerAddr(l net.Listener, addr string, pkfile, certfile string) (net.Listener, error)
- func Server() *tls.Config
- type CertContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildListenerConfig ¶
BuildListenerConfig builds a tls.Config for a listener at the given addr
func Listen ¶
Listen opens a TLS listener at the given address using the private key and certificate PEM files at the given paths. If no files exists, it creates a new key and self-signed certificate at those locations.
func NewListener ¶
NewListener creates a TLS listener based on the given listener using the private key and certificate PEM files at the given paths. If no files exists, it creates a new key and self-signed certificate at those locations.
func NewListenerAddr ¶
NewListenerAddr is like NewListener but uses the specified addr to generate the cert.
Types ¶
type CertContext ¶
type CertContext struct { PKFile string ServerCertFile string PK *keyman.PrivateKey ServerCert *keyman.Certificate }
CertContext encapsulates the certificates used by a Server