Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientAuthClient ¶
Types ¶
type ClientAuthListener ¶
type ClientAuthListener struct {
// contains filtered or unexported fields
}
func NewClientAuthListener ¶
func NewClientAuthListener( l *net.TCPListener, ca *x509.CertPool, serverCert tls.Certificate, handshakeTimeout time.Duration) *ClientAuthListener
func (*ClientAuthListener) Accept ¶
func (l *ClientAuthListener) Accept() (tcpConn *net.TCPConn, tlsConn *tls.Conn, clientCN string, err error)
Accept() accepts a connection from the *net.TCPListener passed to the constructor and sets up the TLS connection, including handshake and peer CommonName validation within the specified handshakeTimeout.
It returns both the raw TCP connection (tcpConn) and the TLS connection (tlsConn) on top of it. Access to the raw tcpConn might be necessary if CloseWrite semantics are desired: tlsConn.CloseWrite does NOT call tcpConn.CloseWrite, hence we provide access to tcpConn to allow the caller to do this by themselves.
func (*ClientAuthListener) Addr ¶
func (l *ClientAuthListener) Addr() net.Addr
func (*ClientAuthListener) Close ¶
func (l *ClientAuthListener) Close() error
Click to show internal directories.
Click to hide internal directories.