Versions in this module Expand all Collapse all v11 v11.3.3 Dec 13, 2022 Changes in this version + func CheckCertSubject(cert *x509.Certificate, dbRoute tlsca.RouteToDatabase) error + func DialALPN(ctx context.Context, addr string, cfg ALPNDialerConfig) (*tls.Conn, error) + func IsALPNConnUpgradeRequired(addr string, insecure bool) bool + func IsConnectRequest(req *http.Request) bool + func MatchAWSRequests(req *http.Request) bool + func MatchAllRequests(req *http.Request) bool + type ALPNDialer struct + func (d ALPNDialer) DialContext(ctx context.Context, network, addr string) (net.Conn, error) + type ALPNDialerConfig struct + ALPNConnUpgradeRequired bool + DialTimeout time.Duration + KeepAlivePeriod time.Duration + TLSConfig *tls.Config + type CertGenListener struct + func NewCertGenListener(config CertGenListenerConfig) (*CertGenListener, error) + func (r *CertGenListener) GetCertificate(clientHello *tls.ClientHelloInfo) (*tls.Certificate, error) + type CertGenListenerConfig struct + CA tls.Certificate + ListenAddr string + func (c *CertGenListenerConfig) CheckAndSetDefaults() error + type ConnectRequestHandler interface + Handle func(ctx context.Context, clientConn net.Conn, req *http.Request) + Match func(req *http.Request) bool + type ConnectionHandler func(ctx context.Context, conn net.Conn) error + type ConnectionHandlerWrapper struct + func (w *ConnectionHandlerWrapper) HandleConnection(ctx context.Context, conn net.Conn) error + func (w *ConnectionHandlerWrapper) Set(h ConnectionHandler) + type ConnectionInfo struct + ALPN []string + SNI string + type ContextDialer interface + DialContext func(ctx context.Context, network, addr string) (net.Conn, error) + func NewALPNDialer(cfg ALPNDialerConfig) ContextDialer + type ForwardProxy struct + func NewForwardProxy(cfg ForwardProxyConfig) (*ForwardProxy, error) + func (p *ForwardProxy) Close() error + func (p *ForwardProxy) GetAddr() string + func (p *ForwardProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) + func (p *ForwardProxy) Start() error + type ForwardProxyConfig struct + CloseContext context.Context + Handlers []ConnectRequestHandler + Listener net.Listener + func (c *ForwardProxyConfig) CheckAndSetDefaults() error + type ForwardToHostHandler struct + func NewForwardToHostHandler(cfg ForwardToHostHandlerConfig) *ForwardToHostHandler + func NewForwardToOriginalHostHandler() *ForwardToHostHandler + func (h *ForwardToHostHandler) Handle(ctx context.Context, clientConn net.Conn, req *http.Request) + func (h *ForwardToHostHandler) Match(req *http.Request) bool + type ForwardToHostHandlerConfig struct + Host string + MatchFunc func(req *http.Request) bool + func (c *ForwardToHostHandlerConfig) SetDefaults() + type ForwardToSystemProxyHandler struct + func NewForwardToSystemProxyHandler(cfg ForwardToSystemProxyHandlerConfig) *ForwardToSystemProxyHandler + func (h *ForwardToSystemProxyHandler) Handle(ctx context.Context, clientConn net.Conn, req *http.Request) + func (h *ForwardToSystemProxyHandler) Match(req *http.Request) bool + type ForwardToSystemProxyHandlerConfig struct + InsecureSystemProxy bool + SystemProxyFunc func(reqURL *url.URL) (*url.URL, error) + TunnelProtocol string + func (c *ForwardToSystemProxyHandlerConfig) SetDefaults() + type HandlerDecs struct + ForwardTLS bool + Handler HandlerFunc + HandlerWithConnInfo HandlerFuncWithInfo + MatchFunc MatchFunc + TLSConfig *tls.Config + func (h *HandlerDecs) CheckAndSetDefaults() error + type HandlerFunc func(ctx context.Context, conn net.Conn) error + type HandlerFuncWithInfo func(ctx context.Context, conn net.Conn, info ConnectionInfo) error + func ExtractMySQLEngineVersion(fn func(ctx context.Context, conn net.Conn) error) HandlerFuncWithInfo + type ListenerMuxWrapper struct + func NewMuxListenerWrapper(serviceListener, alpnListener net.Listener) *ListenerMuxWrapper + func (l *ListenerMuxWrapper) Accept() (net.Conn, error) + func (l *ListenerMuxWrapper) Addr() net.Addr + func (l *ListenerMuxWrapper) Close() error + func (l *ListenerMuxWrapper) HandleConnection(ctx context.Context, conn net.Conn) error + type LocalProxy struct + func NewLocalProxy(cfg LocalProxyConfig) (*LocalProxy, error) + func (l *LocalProxy) CheckDBCerts(dbRoute tlsca.RouteToDatabase) error + func (l *LocalProxy) Close() error + func (l *LocalProxy) GetAddr() string + func (l *LocalProxy) SetCerts(certs []tls.Certificate) + func (l *LocalProxy) Start(ctx context.Context) error + func (l *LocalProxy) StartAWSAccessProxy(ctx context.Context) error + type LocalProxyConfig struct + ALPNConnUpgradeRequired bool + AWSCredentials *credentials.Credentials + Certs []tls.Certificate + Clock clockwork.Clock + InsecureSkipVerify bool + Listener net.Listener + Log logrus.FieldLogger + Middleware LocalProxyMiddleware + ParentContext context.Context + Protocols []common.Protocol + RemoteProxyAddr string + RootCAs *x509.CertPool + SNI string + SSHHostKeyCallback ssh.HostKeyCallback + SSHTrustedCluster string + SSHUser string + SSHUserHost string + func (cfg *LocalProxyConfig) CheckAndSetDefaults() error + func (cfg *LocalProxyConfig) GetProtocols() []string + type LocalProxyMiddleware interface + OnNewConnection func(ctx context.Context, lp *LocalProxy, conn net.Conn) error + OnStart func(ctx context.Context, lp *LocalProxy) error + type MatchFunc func(sni, alpn string) bool + func MatchByALPNPrefix(prefix string) MatchFunc + func MatchByProtocol(protocols ...common.Protocol) MatchFunc + func MatchByProtocolWithPing(protocols ...common.Protocol) MatchFunc + type PingConn struct + func NewPingConn(conn *tls.Conn) *PingConn + func (c *PingConn) Read(p []byte) (int, error) + func (c *PingConn) Write(p []byte) (int, error) + func (c *PingConn) WritePing() error + type Proxy struct + func New(cfg ProxyConfig) (*Proxy, error) + func (p *Proxy) Close() error + func (p *Proxy) MakeConnectionHandler(defaultOverride *tls.Config) ConnectionHandler + func (p *Proxy) Serve(ctx context.Context) error + type ProxyConfig struct + AccessPoint auth.ReadProxyAccessPoint + Clock clockwork.Clock + ClusterName string + IdentityTLSConfig *tls.Config + Listener net.Listener + Log logrus.FieldLogger + PingInterval time.Duration + ReadDeadline time.Duration + Router *Router + WebTLSConfig *tls.Config + func (c *ProxyConfig) CheckAndSetDefaults() error + type Router struct + func NewRouter() *Router + func (r *Router) Add(desc HandlerDecs) + func (r *Router) AddDBTLSHandler(handler HandlerFunc) + func (r *Router) AddKubeHandler(handler HandlerFunc) + func (r *Router) CheckAndSetDefaults() error