From 4b45b6080cda6df07215194366692feaba747c5f Mon Sep 17 00:00:00 2001 From: rosstimothy <39066650+rosstimothy@users.noreply.github.com> Date: Fri, 25 Oct 2024 17:53:48 +0000 Subject: [PATCH] Specify default logger in app.CopyAndConfigureTLS (#47947) As some code begins migrating to slog, there will be no logrus logger to provide to this function. Until the transition is complete, allow a nil logger to be provided and use the default logger instead. --- lib/srv/app/connections_handler.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/srv/app/connections_handler.go b/lib/srv/app/connections_handler.go index 5cc34fb4f0ab5..ca034770c1e51 100644 --- a/lib/srv/app/connections_handler.go +++ b/lib/srv/app/connections_handler.go @@ -755,6 +755,9 @@ func (c *ConnectionsHandler) deleteConnAuth(conn net.Conn) { // for Teleport application proxy servers. func CopyAndConfigureTLS(log logrus.FieldLogger, client authclient.AccessCache, config *tls.Config) *tls.Config { tlsConfig := config.Clone() + if log == nil { + log = logrus.StandardLogger() + } // Require clients to present a certificate tlsConfig.ClientAuth = tls.RequireAndVerifyClientCert