From 950d40d34058316d03dc7efbda0ab7d415f1c198 Mon Sep 17 00:00:00 2001 From: Valentin Kuznetsov Date: Wed, 11 Sep 2024 13:01:50 -0400 Subject: [PATCH] Initialize LogCollector with http client with Root CAs --- server.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/server.go b/server.go index 056abd1..49b0cc9 100644 --- a/server.go +++ b/server.go @@ -1,7 +1,9 @@ package main import ( + "crypto/tls" "log" + "net/http" "time" "github.com/dmwm/auth-proxy-server/auth" @@ -104,6 +106,19 @@ func Server(config string, port, metricsPort int, logFile string, useX509, scito logging.CollectorPassword = Config.CollectorPassword logging.CollectorSize = Config.CollectorSize logging.CollectorVerbose = Config.CollectorVerbose + httpClient := &http.Client{ + Transport: &http.Transport{ + TLSClientConfig: &tls.Config{ + RootCAs: _rootCAs, + }, + }, + } + logging.LogCollector = logging.NewCollector( + Config.CollectorSize, + Config.CollectorURL, + Config.CollectorLogin, + Config.CollectorPassword, + httpClient) // start our servers if useX509 {