diff --git a/pkg/sql/pgwire/BUILD.bazel b/pkg/sql/pgwire/BUILD.bazel index b6f718114e10..caeb1c535a3f 100644 --- a/pkg/sql/pgwire/BUILD.bazel +++ b/pkg/sql/pgwire/BUILD.bazel @@ -56,7 +56,6 @@ go_library( "//pkg/sql/sqltelemetry", "//pkg/sql/types", "//pkg/util", - "//pkg/util/buildutil", "//pkg/util/contextutil", "//pkg/util/duration", "//pkg/util/envutil", diff --git a/pkg/sql/pgwire/pre_serve.go b/pkg/sql/pgwire/pre_serve.go index 2423afbd0c4d..cf8a599b8f8b 100644 --- a/pkg/sql/pgwire/pre_serve.go +++ b/pkg/sql/pgwire/pre_serve.go @@ -22,7 +22,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror" "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgwirebase" "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgwirecancel" - "github.com/cockroachdb/cockroach/pkg/util/buildutil" "github.com/cockroachdb/cockroach/pkg/util/log" "github.com/cockroachdb/cockroach/pkg/util/metric" "github.com/cockroachdb/cockroach/pkg/util/mon" @@ -440,9 +439,6 @@ func (s *PreServeConnHandler) maybeUpgradeToSecureConn( // TODO(knz): Remove this condition - see // https://github.com/cockroachdb/cockroach/issues/53404 if s.cfg.Insecure { - if buildutil.CrdbTestBuild { - log.Infof(ctx, "using insecure mode since version=%d and cfg.Insecure=true", version) - } return } @@ -450,13 +446,6 @@ func (s *PreServeConnHandler) maybeUpgradeToSecureConn( // non-TLS SQL conns. if !s.cfg.AcceptSQLWithoutTLS && connType != hba.ConnLocal && connType != hba.ConnInternalLoopback { clientErr = pgerror.New(pgcode.ProtocolViolation, ErrSSLRequired) - // Extra logs under test to debug TestAuthenticationAndHBARules. - if buildutil.CrdbTestBuild { - log.Warningf(ctx, "client cannot connect since version=%d AcceptSQLWithoutTLS=false and connType=%s", version, connType) - } - } - if buildutil.CrdbTestBuild { - log.Infof(ctx, "client did not request SSL version=%d AcceptSQLWithoutTLS=false and connType=%s", version, connType) } return } @@ -468,19 +457,12 @@ func (s *PreServeConnHandler) maybeUpgradeToSecureConn( // we don't want it. clientErr = pgerror.New(pgcode.ProtocolViolation, "cannot use SSL/TLS over local connections") - // Extra logs under test to debug TestAuthenticationAndHBARules. - if buildutil.CrdbTestBuild { - log.Warningf(ctx, "client cannot connect since version=%d and connType=%s", version, connType) - } return } // Protocol sanity check. if len(buf.Msg) > 0 { serverErr = errors.Errorf("unexpected data after SSLRequest: %q", buf.Msg) - if buildutil.CrdbTestBuild { - log.Warningf(ctx, "protocol error err=%v", serverErr) - } return } @@ -490,36 +472,20 @@ func (s *PreServeConnHandler) maybeUpgradeToSecureConn( // Do we have a TLS configuration? tlsConfig, serverErr := s.getTLSConfig() if serverErr != nil { - if buildutil.CrdbTestBuild { - log.Warningf(ctx, "could not get TLS config err=%v", serverErr) - } return } if tlsConfig == nil { // We don't have a TLS configuration available, so we can't honor // the client's request. - // Extra logs under test to debug TestAuthenticationAndHBARules. - if buildutil.CrdbTestBuild { - log.Infof(ctx, "sending sslUnsupported message to client") - } n, serverErr = conn.Write(sslUnsupported) if serverErr != nil { - if buildutil.CrdbTestBuild { - log.Warningf(ctx, "error while sending sslUnsupported message to client err=%v", serverErr) - } return } } else { - if buildutil.CrdbTestBuild { - log.Infof(ctx, "sending sslSupported message to client") - } // We have a TLS configuration. Upgrade the connection. n, serverErr = conn.Write(sslSupported) if serverErr != nil { - if buildutil.CrdbTestBuild { - log.Warningf(ctx, "error while sending sslSupported message to client err=%v", serverErr) - } return } newConn = tls.Server(conn, tlsConfig) @@ -529,9 +495,6 @@ func (s *PreServeConnHandler) maybeUpgradeToSecureConn( // Finally, re-read the version/command from the client. newVersion, *buf, serverErr = s.readVersion(newConn) - if buildutil.CrdbTestBuild && serverErr != nil { - log.Warningf(ctx, "error when reading version err=%v", serverErr) - } return }