From 5641eea3eaf16de35868b3a585dc99d6c15e62c7 Mon Sep 17 00:00:00 2001 From: rosstimothy <39066650+rosstimothy@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:48:28 +0000 Subject: [PATCH] Specify default logger in app.CopyAndConfigureTLS (#47965) 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 559c812a75b07..1fade7931a4b5 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