From beb5bcb2f3f1c4e6f81efbb43086157aaadbc25f Mon Sep 17 00:00:00 2001 From: Tim Ross Date: Fri, 25 Oct 2024 11:33:37 -0400 Subject: [PATCH] Specify default logger in app.CopyAndConfigureTLS 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