Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LoggingListener ¶
func NewLoggingListener ¶
func NewLoggingListener(l net.Listener, log *zap.SugaredLogger) *LoggingListener
type TLSInfo ¶
type TLSInfo struct {
// CertFile is the _server_ cert, it will also be used as a _client_ certificate if ClientCertFile is empty
CertFile string
// KeyFile is the key for the CertFile
KeyFile string
TrustedCAFile string
ClientCertAuth bool
InsecureSkipVerify bool
// ServerName ensures the cert matches the given host in case of discovery / virtual hosting.
ServerName string
// HandshakeFailure is optionally called when a connection fails to handshake. The
// connection will be closed immediately afterward.
HandshakeFailure func(*tls.Conn, error)
// AllowedCN is a CN which must be provided by a client.
AllowedCN string
// AllowedHostname is an IP address or hostname that must match the TLS
// certificate provided by a client.
AllowedHostname string
// Logger logs TLS errors.
// If nil, all logs are discarded.
Logger *zap.SugaredLogger
// EmptyCN indicates that the cert must have empty CN.
// If true, ClientConfig() will return an error for a cert with non-empty CN.
EmptyCN bool
// contains filtered or unexported fields
}
func (TLSInfo) ClientConfig ¶
ClientConfig generates a tls.Config object for use by an HTTP client.
func (TLSInfo) ServerConfig ¶
ServerConfig generates a tls.Config object for use by an HTTP server.
type TrackingListener ¶
func NewTrackingListener ¶
func NewTrackingListener(l net.Listener) *TrackingListener
Click to show internal directories.
Click to hide internal directories.