Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // PostgresStartTLSMsg is the message sent by PostgreSQL clients to initiate SSL // The message consists of a 4-byte length (8) followed by the SSL request code (80877103) PostgresStartTLSMsg = []byte{0, 0, 0, 8, 4, 210, 22, 47} // int32(8) + int32(80877103) // PostgresStartTLSReply is the single byte 'S' sent back to clients to indicate SSL is supported PostgresStartTLSReply = []byte{83} // 'S' byte )
Functions ¶
This section is empty.
Types ¶
type ListenerWrapper ¶
type ListenerWrapper struct {
// Timeout specifies how long to wait when peeking at connections
Timeout caddy.Duration `json:"timeout,omitempty"`
// Allow specifies which IPs are allowed to use this wrapper
Allow []string `json:"allow,omitempty"`
// Deny specifies which IPs are not allowed to use this wrapper
Deny []string `json:"deny,omitempty"`
Logger *zap.Logger
}
ListenerWrapper provides PostgreSQL SSL support to Caddy by implementing the caddy.ListenerWrapper interface. It detects PostgreSQL's SSL handshake request and responds correctly to enable TLS for PostgreSQL connections.
func (ListenerWrapper) CaddyModule ¶
func (ListenerWrapper) CaddyModule() caddy.ModuleInfo
func (*ListenerWrapper) Provision ¶
func (pp *ListenerWrapper) Provision(ctx caddy.Context) error
Provision sets up the listener wrapper.
func (*ListenerWrapper) UnmarshalCaddyfile ¶
func (w *ListenerWrapper) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile sets up the listener Listenerwrapper from Caddyfile tokens. Syntax:
postgres_ssl {
timeout <duration>
allow <IPs...>
deny <IPs...>
}
func (*ListenerWrapper) WrapListener ¶
func (pp *ListenerWrapper) WrapListener(l net.Listener) net.Listener
WrapListener adds PostgreSQL SSL support to the listener.
Click to show internal directories.
Click to hide internal directories.