src/server/pkg/cert/logging_conn.go
func (l *TestListener) Dial(context.Context, string, string) (net.Conn, error) {
	l.connMu.Lock()
	defer l.connMu.Unlock()
	if l.conn != nil {
		return nil, errors.New("Dial() has already been called on this TestListener")
	}

	// Initialize logging pipe
	p := newLoggingPipe()
	l.conn = p.serverConn()

	// send serverConn to Accept() and close l.connCh (so future callers to
	// Accept() get nothing)
	l.connCh <- p.serverConn()
	close(l.connCh)
	return p.clientConn(), nil
}
func (l *TestListener) Dial(context.Context, string, string) (net.Conn, error) {
	l.connMu.Lock()
	defer l.connMu.Unlock()
	if l.conn != nil {
		return nil, errors.New("Dial() has already been called on this TestListener")
	}

	// Initialize logging pipe
	p := newLoggingPipe()
	l.conn = p.serverConn()

	// send serverConn to Accept() and close l.connCh (so future callers to
	// Accept() get nothing)
	l.connCh <- p.serverConn()
	close(l.connCh)
	return p.clientConn(), nil
}
// Dial initializes a new connection and releases a blocked call to Accept()